|
-
Apr 8th, 2001, 12:51 PM
#1
Thread Starter
Junior Member
Hello, i've got a problem with adding records to a database.
Here's the code for adding a record:
set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};" & "DBQ=c:\documenti\forum.mdb"
conn.Open
set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Threads", conn, , adLockOptimistic, adCmdTable
'You must imagine a form first
rs.addnew
rs("title")=request("strtitle")
rs("from")=request.cookies("forum")("user")
rs("text")=request("strtext")
rs.update
when the script calls rs.update, it's a sintax error for INSERT INTO
why? It's because i'm adding wrong type of data in the db fields? The title is text, the from is text and the title is memo (long text)
Or is because the table has pre-defined fields? ID is a counter and time and date have a default value of time() and date()
Where's the mistake?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|