7 messages in com.mysql.lists.win32Re: Correct syntax for 'insert'ing data
FromSent OnAttachments
Ron Smith21 Apr 2005 12:43 
Randy Clamons21 Apr 2005 13:00 
jbon...@sola.com.au21 Apr 2005 15:49 
Ron Smith21 Apr 2005 15:58 
Ron Smith21 Apr 2005 16:09 
Randy Clamons21 Apr 2005 17:26 
jbon...@sola.com.au25 Apr 2005 15:45 
Subject:Re: Correct syntax for 'insert'ing data
From:Randy Clamons (ran@novaspace.com)
Date:04/21/2005 01:00:49 PM
List:com.mysql.lists.win32

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.