VB6 – Non ODBC

Set db = New Connection
db.CursorLocation = adUseClient
db.Open “PROVIDER=MSDataShape;Data PROVIDER=” & _
“Microsoft.Jet.OLEDB.4.0;Data Source=” _
& App.Path & “\fpdata.mdb;Jet OLEDB:” & _
“Database Password=”;”

Visual Foxpro – ODBC

STORE SQLCONNECT(’exdata’, ‘admin’,”) TO gnConnHandle
IF gnConnHandle <= 0
= MESSAGEBOX(’Cannot make connection’, 16, ‘SQL Connect Error’)

*!* execute
SQLEXEC(gnConnHandle,”SELECT * FROM USER”,”USER”)
ENDIF

Advertisements

Private Sub cmdDownload01_Click()
If lStatusKonek Then
If chkDownload.Value = 0 Then
cmdDownload01.Enabled = False
MousePointer = vbHourglass
End If
Dim dwEnrollNumber As Long
Dim dwVerifyMode As Long
Dim dwInOutMode As Long
Dim timeStr As String
Dim i As Long
Dim lAddNew As Boolean

Dim v1 As String, v2 As Long, v3 As Long

lvX.Refresh
If chkDownload.Value = 1 Then
lvX.ListItems.Clear
End If

v1 = CStr(!no_id)
v2 = !baudrate
v3 = !no_port

If CZKEM1.ReadGeneralLogData(v1) Then
i = 1
CZKEM1.ReadAllUserID v1 ”cboNoMesin01
While CZKEM1.GetGeneralLogDataStr(v1, dwEnrollNumber, dwVerifyMode, dwInOutMode, timeStr)

lvX.ListItems.Add i, , dwEnrollNumber
With lvX.ListItems(i)
.SubItems(1) = IIf(IsNull(timeStr), “”, timeStr)
.SubItems(2) = IIf(IsNull(v1), “”, v1)
.SubItems(3) = IIf(IsNull(dwVerifyMode), “”, IIf(dwVerifyMode = 1, “Fingerprint”, “Password”))
DoEvents
End With

Dim d_TimeStr As Date
d_TimeStr = CDate(Left(Right(Left(timeStr, 10), 2) & “-” & Mid(Left(timeStr, 10), 6, 2) & “-” & Left(Left(timeStr, 10), 4) & ” ” & Right(Trim(timeStr), 8), Len(Right(Left(timeStr, 10), 2) & “-” & Mid(Left(timeStr, 10), 6, 2) & “-” & Left(Left(timeStr, 10), 4) & ” ” & Right(Trim(timeStr), 8))))

lvX.ListItems.Add i, , dwEnrollNumber
With lvX.ListItems(i)
.SubItems(1) = IIf(IsNull(timeStr), “”, timeStr)
.SubItems(2) = IIf(IsNull(v1), “”, v1)
.SubItems(3) = IIf(IsNull(dwVerifyMode), “”, IIf(dwVerifyMode = 1, “Fingerprint”, “Password”))
DoEvents
End With

End If
End With

lvX.Refresh
Wend
End If
.MoveNext
Wend
End With
If chkDownload.Value = 0 Then
cmdDownload01.Enabled = True
MousePointer = vbDefault
End If
adoMesinConnect.Close
End If

End Sub