MySQL Insert and VB6

Hi,

I am currently using the VB6 statement

[code]
MySQLQuery("INSERT INTO clients VALUES ('" & vbvar1 & "', '" & vbvar2 & "', '" & vbvar3 &"')")
[/code]

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

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

I would guess that this converts to vb in the following way
[code]
MySQLQuery("INSERT INTO '`clients`' ('`column1`','`column2`','`column3`') VALUES ('" & vbvar1 & "','" & vbvar2 & "','" & vbvar3 & "')")
[/code]
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.

Thanks


Sign In or Register to comment.

Howdy, Stranger!

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

Categories