M
Mac
Public Function REFRESH() As Boolean
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim strsql As String
Dim SQLSVRSTR As String
Dim SQLDBStr As String
Dim userpassstr As String
SQLSVRSTR = Trim(Eval("OcOMPANY.fcSQLServer"))
SQLDBStr = Trim(Eval("OcOMPANY.fcSQLDB"))
MsgBox SQLSVRSTR
MsgBox SQLDBStr
'MsgBox ThisForm.grdcomponents.colpart.txtfbompart.Value
strcnn = "DRIVER=SQL SERVER; SERVER=" & SQLSVRSTR & ";" & _
"UID=sa;PWD=just4admin;DATABASE=" & SQLDBStr & ";"
Set cn = New ADODB.Connection
' cn.Open strcnn
MPARTNBR = ThisForm.grdcomponents.colpart.txtfbompart.Value
MPARTREV = ThisForm.grdcomponents.colrev.txtfbomrev.Value
strsql = "Select fonhand from inmast WHERE INMAST.FPARTNO = " & MPARTNBR & "
and INMAST.frev=" & MPARTREV
' strsql = "select * from inmast"
Set rs = New ADODB.Recordset
rs.Cursortype = adopenkeyset
rs.Locktype = adlockoptimistic
cn.Open strcnn
rs.Open strsql, cn
If rs.bof Then
Debug.Print "we don't have any, it seems "
Else
Debug.Print "there are " & rs!fonhand & _
" of them on hand. "
End If
rs.close
cn.close
REFRESH = True
End Function
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim strsql As String
Dim SQLSVRSTR As String
Dim SQLDBStr As String
Dim userpassstr As String
SQLSVRSTR = Trim(Eval("OcOMPANY.fcSQLServer"))
SQLDBStr = Trim(Eval("OcOMPANY.fcSQLDB"))
MsgBox SQLSVRSTR
MsgBox SQLDBStr
'MsgBox ThisForm.grdcomponents.colpart.txtfbompart.Value
strcnn = "DRIVER=SQL SERVER; SERVER=" & SQLSVRSTR & ";" & _
"UID=sa;PWD=just4admin;DATABASE=" & SQLDBStr & ";"
Set cn = New ADODB.Connection
' cn.Open strcnn
MPARTNBR = ThisForm.grdcomponents.colpart.txtfbompart.Value
MPARTREV = ThisForm.grdcomponents.colrev.txtfbomrev.Value
strsql = "Select fonhand from inmast WHERE INMAST.FPARTNO = " & MPARTNBR & "
and INMAST.frev=" & MPARTREV
' strsql = "select * from inmast"
Set rs = New ADODB.Recordset
rs.Cursortype = adopenkeyset
rs.Locktype = adlockoptimistic
cn.Open strcnn
rs.Open strsql, cn
If rs.bof Then
Debug.Print "we don't have any, it seems "
Else
Debug.Print "there are " & rs!fonhand & _
" of them on hand. "
End If
rs.close
cn.close
REFRESH = True
End Function