MySQL Insert and VB6 - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

MySQL Insert and VB6

samuelmoneillsamuelmoneill Posts: 14Member

I am currently using the VB6 statement

MySQLQuery("INSERT INTO clients VALUES ('" & vbvar1 & "', '" & vbvar2 & "', '" & vbvar3 &"')")

to insert records into my mysql database which worked fine until I needed to add an auto_increment value to my client table.

In mysql the auto increment syntax is

INSERT INTO `clients` (`column1`,`column2`,`column3`) VALUES ('Tom', 'Dick', 'Harry');

I would guess that this converts to vb in the following way
MySQLQuery("INSERT INTO '`clients`' ('`column1`','`column2`','`column3`') VALUES ('" & vbvar1 & "','" & vbvar2 & "','" & vbvar3 & "')")
but it does not.

Does anyone have any ideas.

Sorry if my explanation is a little confusing.
I created the MySQLQuery() function myself and it works fine. The issue I am having is representing MySQL column and table names in vb.


Sign In or Register to comment.