Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

update and set command to foxpro file

Status
Not open for further replies.

marcsorg

MIS
Feb 23, 2001
7
US
I am having a problem updating a foxpro record in a table with the sql update and set command. The problem is that I get a data type mismatch error when I try to set a foxpro date field with vb.net Today or Now.
enclosed are the lines of code.
Dim MDATE As String
MDATE = Today
If mcount = 0 And mstatus = "APPROVED" And dtinterval > 30 Then
connx3.Query = "update tcmainwk set status = 'NEVACTIVE' where alltrim(tcid) = '" & mtcid & "' "
connx3.ExecuteNoResp()
connx3.Query = "update tcmainwk set dispdt =" & MDATE & " where alltrim(tcid) = '" & mtcid & "' "
connx3.ExecuteNoResp()

comment = "STATUS CHNG FR APPROVED TO NEVACTIVE"
Connx2.Query = "insert into dlychng (date,comment,initial,tcid,dept) values (" & MDATE & ",'" & comment & "','" & INITIAL & "','" & mtcid & "','" & DEPT & ")"
Connx2.ExecuteNoResp()
End If


The code bombs out when I try to 'set dispdt= MDATE'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top