Jump to content

SQL (not MySQL) access


jimg
 Share

Recommended Posts

I'm trying to access my SQL database (NOT a Mysql database) to extract some information, and need some guidance.

I tried following the thread about Mysql hoping that it would suffice, but I get a failure within Mysql.au3 (line 27)

$Objconn.open(xx)

$Objconn.open(xx)^ERROR

Error: The requested action for this object has failed.

I checked ODBCAD32.exe, and it shows the MySQL OBDC 3.51 Driver is there (as is an SQL Server driver).

Should I expect my SQL 2000 server to respond properly to a Mysql access or can I change something to use the real SQL driver?

I'm a hardware guy, not a programmer, so be gentle :)

#include <mysql.au3>

#include <SQLite.dll.au3>

$sql = _MySQLConnect("sa","password","database","sqlserver") [values changed to protect the innocent]

$var = _Query($sql,"SELECT * FROM ENTY_Person WHERE Person_LastName LIKE 'GUR%'")

With $var

While NOT .EOF

FileWriteLine("test.txt",.Fields("Lastname").value & @CRLF)

.MoveNext

WEnd

EndWith

_MySQLEnd($sql)

Link to comment
Share on other sites

It's an SQL 2000 (SQL Version 8) database. I tried just modifying the driver name within mysql.au3 (to {SQL Driver} which shows in my list of drivers) but I got the same error.

No doubt, the failure is to do with you not actually connecting to a MySQL database.

What flava of SQL db is it?

Link to comment
Share on other sites

I can open my SQL database just fine with Excel, so I know the server, database name, table name, and column names are okay.

The MySQL.au3 function to open gets to the OBJCONN instruction on line 27, so I think that means the driver is there.

I'm basically flailing over my head, so any hint would be much appreciated. Maybe someone can recommend a good book...

It's an SQL 2000 (SQL Version 8) database. I tried just modifying the driver name within mysql.au3 (to {SQL Driver} which shows in my list of drivers) but I got the same error.

Link to comment
Share on other sites

  • 3 weeks later...

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...