Jump to content

How to connect to MySql Server?


hunt
 Share

Recommended Posts

Hello all! Help me please. I don't know to connect to my MySql server with AutoItScript. I looked other topics and i cant' undetstand what i do wrong.

All time appears error:

==> The requested action with this object has failed.:

$oAdoCon.Open ($sCon)

$oAdoCon.Open ($sCon)^ ERROR

; Open the database and recordset

Func _OpenDBRS(ByRef $oAdoCon, ByRef $oAdoRs, ByRef $sCon, ByRef $sQuery, ByRef $iCurType, ByRef $iLockType)

$oAdoCon = ObjCreate ("ADODB.Connection") ; Create the database connection

$oAdoCon.Open ($sCon) ; Open the database

$oAdoRs = ObjCreate ("ADODB.Recordset") ; Create the recordset connection

$oAdoRs.CursorType = $iCurType ; {See description above}

$oAdoRs.LockType = $iLockType ; {See description above}

$oAdoRs.Open ($sQuery, $oAdoCon) ; Open the recordset

EndFunc ; _OpenDBRS()

What i must to do?

Edited by hunt
Link to comment
Share on other sites

  • 1 month later...

Hello all! Help me please. I don't know to connect to my MySql server with AutoItScript. I looked other topics and i cant' undetstand what i do wrong.

All time appears error:

==> The requested action with this object has failed.:

$oAdoCon.Open ($sCon)

$oAdoCon.Open ($sCon)^ ERROR

; Open the database and recordset

Func _OpenDBRS(ByRef $oAdoCon, ByRef $oAdoRs, ByRef $sCon, ByRef $sQuery, ByRef $iCurType, ByRef $iLockType)

$oAdoCon = ObjCreate ("ADODB.Connection") ; Create the database connection

$oAdoCon.Open ($sCon) ; Open the database

$oAdoRs = ObjCreate ("ADODB.Recordset") ; Create the recordset connection

$oAdoRs.CursorType = $iCurType ; {See description above}

$oAdoRs.LockType = $iLockType ; {See description above}

$oAdoRs.Open ($sQuery, $oAdoCon) ; Open the recordset

EndFunc ; _OpenDBRS()

What i must to do?

Hi there, search the forum for MySQL, you'll get this:

A MySQL UDFs, without ODBC, uses libmysql.dll

http://www.autoitscript.com/forum/index.php?showtopic=85617

Helpful ?

[font="Lucida Sans Unicode"]M a k. a v e L ![/font]

Link to comment
Share on other sites

Hello all! Help me please. I don't know to connect to my MySql server with AutoItScript. I looked other topics and i cant' undetstand what i do wrong.

All time appears error:

==> The requested action with this object has failed.:
$oAdoCon.Open ($sCon)
$oAdoCon.Open ($sCon)^ ERROR

; Open the database and recordset
Func _OpenDBRS(ByRef $oAdoCon, ByRef $oAdoRs, ByRef $sCon, ByRef $sQuery, ByRef $iCurType, ByRef $iLockType)
    $oAdoCon = ObjCreate ("ADODB.Connection"); Create the database connection
    [b]$oAdoCon.Open ($sCon); Open the database[/b]
    $oAdoRs = ObjCreate ("ADODB.Recordset"); Create the recordset connection
    $oAdoRs.CursorType = $iCurType; {See description above}
    $oAdoRs.LockType = $iLockType; {See description above}
    $oAdoRs.Open ($sQuery, $oAdoCon); Open the recordset
EndFunc; _OpenDBRS()

What i must to do?

Show us the connection parameters passed in $sCon (obfuscate any servernames/usernames/passwords).

Either the connection string is wrong or basic connectivity to the server is bad. If you add an AutoIt COM error handler (see help file), you will get more detail on the error.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...