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.
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL