vitanza
asked on
modify dbf file - ASP
I am trying to add a row in a DBF file - Here is my code:
'''''''''''''''''''''''''' ''''''''''
Dim objConn
Set objConn = Server.CreateObject("ADODB .Connectio n")
objConn.Open "CONVLOG"
if request("submit") = "Post Message" and request("filenm") <> "" then
objconn.execute "INSERT INTO CONVLOG (FILENM,CONVDATE,CONVTIME, USERID,CON VDESC) VALUES ('" & request("filenm") & "','" & Date & "','" & FormatDateTime(Time,4) & "','" & session("name") & "','" & request("msg") & "')"
end if
'''''''''''''''''''''''''' '''''''''
I get this error
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC Visual FoxPro Driver]Data type mismatch.
/login/convlog.asp, line 10
'''''''''''''''''''''''''' '''''''''' ''''
Line 10 is the "objconn.execute" line.
I'm not sure what the data type mismatch is - I do know that the field CONVDESC is a memo field and I think the CONVDATE and CONVTIME fields are date/time fields. I'm not even sure how to find out - I didn't create this database; it's a program's database. I can open it in Excel and look around, but I'm pretty much stuck.
''''''''''''''''''''''''''
Dim objConn
Set objConn = Server.CreateObject("ADODB
objConn.Open "CONVLOG"
if request("submit") = "Post Message" and request("filenm") <> "" then
objconn.execute "INSERT INTO CONVLOG (FILENM,CONVDATE,CONVTIME,
end if
''''''''''''''''''''''''''
I get this error
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC Visual FoxPro Driver]Data type mismatch.
/login/convlog.asp, line 10
''''''''''''''''''''''''''
Line 10 is the "objconn.execute" line.
I'm not sure what the data type mismatch is - I do know that the field CONVDESC is a memo field and I think the CONVDATE and CONVTIME fields are date/time fields. I'm not even sure how to find out - I didn't create this database; it's a program's database. I can open it in Excel and look around, but I'm pretty much stuck.
but just to let you know ... #Date# is Access format, so there is a good chance that may not work
ASKER
now I get "Syntax Error"...
objconn.execute "INSERT INTO CONVLOG (FILENM,CONVDATE,CONVTIME, USERID,CON VDESC) VALUES (" & request("filenm") & ",#" & date & "#,#" & FormatDateTime(time,4) & "#,'" & session("name") & "','" & request("msg") & "')"
I also got rid of the ' 's around filenm because its a number. Well I'm not even sure about that because it's fixed width....example: 00000532. Hmm how can I check the data types of these fields?
objconn.execute "INSERT INTO CONVLOG (FILENM,CONVDATE,CONVTIME,
I also got rid of the ' 's around filenm because its a number. Well I'm not even sure about that because it's fixed width....example: 00000532. Hmm how can I check the data types of these fields?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Nice, the { } works. Thanks.
assuming USERID is not a number since you have session("name") going into it.
if USERID is a number then you do not need the ' 's around it