I have to update/insert records into a VFP free table.
Code follows below...
Dim Conn As Variant
Dim sql_cmd As String, qry_cmd As String
'
Set Conn = CreateObject("ADODB.Connection")
Conn.Mode = 16 ' ShareDenyNone
Conn.CursorLocation= 3 'Client Side Cursor
Conn.Open "Provider=VFPOLEDB;Data Source=E:\RETAIL\DATA\"
'
sql_cmd = "insert into xrtlparts (" & cInsertFields & ") values (" & cInsertValues & ")"
Dim objRS As Variant
Set objRS = CreateObject("ADODB.RecordSet")
Set acmd = CreateObject("ADODB.Command")
'
acmd.CommandText = sql_cmd
Set acmd.ActiveConnection = Conn
'
Set objRS = acmd.Execute
*-----End of Code ----
I can update/insert records with numeric or character data, but not with dates.
I get the message "Microsoft OLEDB Provider for Visual Foxpro: Data type mismatch"
I believe the date format I'm using is incorrect ("MM/DD/YYYY"). Can anyone shed any light on this? Thanks for any help
(Yes, its not VB it's Lotus script, but hopefully its a data format problem and not a dev environment problem)
Wayne
Code follows below...
Dim Conn As Variant
Dim sql_cmd As String, qry_cmd As String
'
Set Conn = CreateObject("ADODB.Connection")
Conn.Mode = 16 ' ShareDenyNone
Conn.CursorLocation= 3 'Client Side Cursor
Conn.Open "Provider=VFPOLEDB;Data Source=E:\RETAIL\DATA\"
'
sql_cmd = "insert into xrtlparts (" & cInsertFields & ") values (" & cInsertValues & ")"
Dim objRS As Variant
Set objRS = CreateObject("ADODB.RecordSet")
Set acmd = CreateObject("ADODB.Command")
'
acmd.CommandText = sql_cmd
Set acmd.ActiveConnection = Conn
'
Set objRS = acmd.Execute
*-----End of Code ----
I can update/insert records with numeric or character data, but not with dates.
I get the message "Microsoft OLEDB Provider for Visual Foxpro: Data type mismatch"
I believe the date format I'm using is incorrect ("MM/DD/YYYY"). Can anyone shed any light on this? Thanks for any help
(Yes, its not VB it's Lotus script, but hopefully its a data format problem and not a dev environment problem)
Wayne