SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    Aug 2005
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    connecting to mysql

    Hi i am a newbie to QARun .Can i access a mysql database using QARun

    Thanks

  2. #2
    Senior Member
    Join Date
    Sep 2004
    Location
    UK
    Posts
    107
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: connecting to mysql

    You need to setup an ODBC connection to the database and then use the code:

    dbConnect( "DSN=mysql" )

    where mysql is the data source name you have entered for the ODBC.

    Hope this helps,
    cheers.

  3. #3
    Junior Member
    Join Date
    Aug 2005
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: connecting to mysql

    Thanks i had to download a mysql odbc driver .But when i try to run some query as given in the help i get the following error

    Runtime error:
    This operation can only be performed on the results of an executed sql statement in script "script name" at line 9

  4. #4
    Senior Member
    Join Date
    Apr 2004
    Location
    Crewe, England
    Posts
    304
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: connecting to mysql

    Skhari,

    Whenever I've encountered this message (when working in QARun with an Access Database) it's because I've tried to execute a command like "dbmovenext" before I've run a select query.

    Suggest that you start by "proving" that you can connect to the database ok.

    Do this by
    dbConnect( "DSN=mysql" )

    Then execute a simple sql select query that you know will return some records

    dbexecute("sql string")

    then get the number of record returned

    dbMoveFirst( )

    While dbEOF( ) = 0
    dbMoveNext( )
    EndWhile

    rcount = dbRecordCount( )

    Then display the number of records

    msgbox("No of reocrds = ", rcount)

    Then disconnect from the database

    dbdisconnect()

    Hope this helps
    Graham

  5. #5
    Junior Member
    Join Date
    Aug 2005
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: connecting to mysql

    Thanks Graham now a new error comes when i connect to the mysql database .

    runtime error
    odbc driver does not support dynasets

    this is what i am doing

    dbconnect("DSN=test;UID=uid;PWD=pwd")
    dbselect("select * from pet")
    dbmovefirst()
    while dbeof()=0
    MessageBox( "test1" ,dbgetfield("name") )
    dbmovenext()
    endwhile
    dbdisconnect()

    could this be a problem with the odbc my sql driver ?

    Thanks

  6. #6
    Senior Member
    Join Date
    Apr 2004
    Location
    Crewe, England
    Posts
    304
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: connecting to mysql

    skhari,

    Either a problem with the ODBC driver or there's a parameter missing in the connection string in dbconnect() which defines the type of database access allowed. You could perhaps check this up in any documentation you've got on the driver.

    I have to admit I don't know enough about ODBC connections and drivers to offer much more help than this.

    I'm sure that some of our colleagues more knowledgeable in this area can "pitch in" and help.
    Graham

  7. #7
    Senior Member
    Join Date
    Apr 2004
    Location
    Crewe, England
    Posts
    304
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: connecting to mysql

    skhari,

    Another thought.

    Could it be anything to do with the database sign on you are using?

    Do you perhaps need to sign on as an administrator?

    -----------------------------

    Come on guys - help out here!

    ------------------------------
    Graham

  8. #8
    Junior Member
    Join Date
    Aug 2005
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: connecting to mysql

    I connected as an admin.It works fine when i use access odbc connection but doesn't when i connect using odbc for mysql .

  9. #9
    Member
    Join Date
    Jul 2004
    Posts
    99
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: connecting to mysql

    In your DBSelect statement try DBSelect( "SQL Statement" , 'SnapShot' ) that way you are not attempting to open the database for modification.

    [ 08-25-2005, 05:59 AM: Message edited by: DLon ]

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.00%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 03:38 AM.

Copyright BetaSoft Inc.