Ron,
You need to interpolate your variables, strings must be quoted. Looks like
you're using some flavor of VB. Try something like this:
sql="insert into contact_info.friends (Name, Address, City, State, Zip,
Phone) values ('"&name&"', '"&address&"', '"&city&"', '"&state&"', '"+zip&"',
'"&phone&"')"
set objRS=objConn.execute(sql)
------------Original Message------------
From: Ron Smith <geek...@yahoo.com>
To: "MySQL Mailing List" <win...@lists.mysql.com>
Date: Thu, Apr-21-2005 12:44 PM
Subject: Correct syntax for 'insert'ing data
I'm having problems with the syntax for entering data. I'm using:
objRS.AddNew
objRS("Name") = name
objRS("Address") = address
objRS("City") = city
objRS("State") = state
objRS("Zip") = zip
objRS("Phone") = phone
objRS.Update
for an "MS Access" database.
What would be the correct syntax adding to a MySQL database.
I was using:
sql="insert into contact_info.friends (Name, Address, City, State, Zip,
Phone) values (name, address, city, state, zip, phone)"
set objRS=objConn.execute(sql)
but it errors out.