|
-
Aug 29th, 2000, 09:00 AM
#1
Thread Starter
New Member
Can anyone help? - I have my code for updating my database using insert statement - can anyone check it as its bringing up a syntax error and I can't figure it out.
data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
Server.MapPath("vacancies.mdb")
sql_insert = "INSERT INTO job (position,jobdescription,salary,startdate,contact) " & _
VALUES ('" & position & "', '" & jobdescription & "', '" & salary & "', '" & startdate & "', '" & contact & "')"
-
Aug 29th, 2000, 09:23 AM
#2
Hyperactive Member
Looks like you're missing a " in front of VALUES
sql_insert = "INSERT INTO job (position,jobdescription,salary,startdate,contact) " & _
"VALUES ('" & position & "', '" & jobdescription & "', '" & salary & "', '" & startdate & "', '" & contact & "')"
-
Aug 29th, 2000, 03:33 PM
#3
Junior Member
It may b ur solution
data_source = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("vacancies.mdb")
sql_insert = "INSERT INTO job(position,jobdescription,salary,startdate,contact) " _
& "VALUES ('" & position & "', '" & jobdescription & "'," & salary & ",'" & startdate & "', '"& contact & "')"
i 've assumed that salary is the integer field.
-
Aug 29th, 2000, 03:49 PM
#4
Hyperactive Member
Even your startdate may need a # character before and after.
sql_insert = "INSERT INTO job(position,jobdescription,salary,startdate,contact) " _
& "VALUES ('" & position & "', '" & jobdescription & "'," & salary & ",#" & startdate & "#, '"& contact & "')"
I think the best way is to find out what is getting stored in sql_insert by using:
Response.Write sql_insert
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
|