Hi, I have code to access Foxpro DBF table as written below:
I want to execute SQL querry that can get record between 2 dates by user input, i've tried the following SQL querry but it was fail:
my system date is using dd/mm/yyyy format, but the foxpro date format is different.
I hope there is someone who can help here, there might someone here who have tried using FoxPro table in VB6.
Thank you.
Regards,
Rocky
Code:
Dim VerifyConnection As Boolean
Dim sql_dbfcon As String
Set dbfcon = New ADODB.Connection
sql_dbfcon = "DSN=Visual FoxPro Tables;UID=;SourceDB=" & dbfpath & ";SourceType=DBF;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;NUll=Yes;Deleted=Yes;Extended Properties=DBase IV;" 'DRIVER={MySQL ODBC 3.51 Driver};OPTION=16387;SERVER=\\NW410;"
With dbfcon
.Provider = "MSDASQL.1;"
.ConnectionString = sql_dbfcon
.Open
End With
If dbfcon.State = 1 Then
VerifyConnection = True
Else
VerifyConnection = False
End If
If VerifyConnection = False Then
MsgBox "Failed to Connect to DBF file!", vbInformation + vbOKOnly, "Connect2DBF"
Exit Sub
End If
Set dbfrs = New ADODB.Recordset
dbfrs.Open mysql & ";", dbfcon, adOpenStatic, adLockOptimistic
I want to execute SQL querry that can get record between 2 dates by user input, i've tried the following SQL querry but it was fail:
Code:
SELECT * FROM Log WHERE Sdate>={" & sDate1 & "} AND Sdate<={" & sDate2 & "}"
my system date is using dd/mm/yyyy format, but the foxpro date format is different.
I hope there is someone who can help here, there might someone here who have tried using FoxPro table in VB6.
Thank you.
Regards,
Rocky