user2259621
user2259621

Reputation: 11

insert data into ms access, using asp

im trying to insert a new row with new data to an ms access table, using asp page. i have no background in asp, im an android developer, but those are my client specifications. i know im doing something very wrong, but i dont know what... can you please help me? this is what i was trying to do:

<% 
'define variables
dim conn, strsql, strMDBPath

Set conn = Server.CreateObject("ADODB.Connection")

'Connect to the database
strMDBpath = Server.MapPath("data.mdb")
conn.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & strMDBPath

'On Error Resume Next

'write to the database
strSql = "INSERT INTO avi (id,first,last) VALUES ("4", '" yom "','" cobi "')"



conn.Execute(strSql)

'close database
conn.close
Set conn = nothing
%>

Upvotes: 0

Views: 2325

Answers (1)

Martha
Martha

Reputation: 3854

You're missing some ampersands.

strSql = "INSERT INTO avi (id,first,last) VALUES (4, '" & yom & "', '" & cobi & "')"

Upvotes: 1

Related Questions