ADO/VB/MySQL Execute Query error


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: ADO/VB/MySQL Execute Query error

  1. #1
    Join Date
    Jun 2004
    Posts
    3

    Question ADO/VB/MySQL Execute Query error

    Dear all,
    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 !!
    Thanks,
    Nawal Lodha.

  2. #2
    Join Date
    Jun 2004
    Posts
    22
    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

  3. #3
    Join Date
    Jun 2004
    Posts
    3
    Hi josephwalter,

    The 'adCmdText' constant worked for me.

    Thanks so much !! you have been a great help.

    Nawal.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center