ADO/VB/MySQL Execute Query error
I use ADO in VB to connect to MySQL 5.0-alpha.
Suppose my query is:
strQry = "\. abcd.sql"
I try to execute it as
connObj.Execute strQry, , adExecuteNoRecords
where connObj is my connection object.
The strQry, however, gets executed as "Select * from \. abcd.sql" thus throwing incorrect syntax error.
How can I avoid "Select * from" from getting appended in the beginning of all my queries?
Any input would be of immense help !!
Read the help files on the Execute Method of an ADO Connection object. What may be happening is that your CommandText parameter is being interpreted as a table name, rather that a sql statement. You may need to specify a value such as adCmdText as one of your Options parameters.
I'm having trouble finding some of my reference material right now, so the following is an educated guess:
connObj.Execute strQry, , adExecuteNoRecords+adCmdText
The 'adCmdText' constant worked for me.
Thanks so much !! you have been a great help.
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center