Sign in to follow this  
Followers 0
fr33za

Show SQL Query Results

4 posts in this topic

hi made a script to get datas from my sql database.

i'm very new on autoit.

my SQL.au3

CODE
Func _SQLConnect($server, $db, $username, $password)

Global $adCN ;<==Declare variable

$adCN = ObjCreate("ADODB.Connection") ;<==Create SQL connection

$adCN.Open ("DRIVER={SQL Server};SERVER=" & $server & ";DATABASE=" & $db & ";uid=" & $username & ";pwd=" & $password & ";") ;<==Connect with required credentials

EndFunc ;==>_SQLConnect

Func _SQLClose()

$adCN.Close ;==>Close the database

EndFunc ;==>_SQLClose

Func _SQLExecute($query)

$adCN.Execute($query)

EndFunc ;==>_SQLExecute

my getdata.au3

CODE
#include <SQL.au3>

$sqlCurrentGameID = "select * from guid";

_SQLConnect ( 'srv01', 'db2', 'sa', '' );

_SQLExecute ( 'SELECT * FROM guid' );

_SQLClose();

i searched in the forum how to show the results, but i didnt find anything that helped me.

can anyone tell me how the print the results? in a messeage box or anything else =)

Share this post


Link to post
Share on other sites



hi

i can't bring it to work with the SQL Example in the help file :whistle:

can anyone give me an example pls? ^^

Share this post


Link to post
Share on other sites

i can't bring it to work with the SQL Example in the help file :lmao:

What the heck does THAT mean?

You won't be able to write the script until you learn to use the functions. You won't learn to use the functions without experimenting with some examples.

If you just want someone to write a script for you, see the Rent-a-Coder link in my sig, below.

What we do here is help you learn to write it yourself. If you don't want to do that, you are in the wrong place...

:whistle:


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

Share this post


Link to post
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
Sign in to follow this  
Followers 0