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'
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'