Jump to content
Sign in to follow this  
Nachiket

Database Connection error

Recommended Posts

Nachiket

Hi I am using the following code to connect to the database

$sqlCon = ObjCreate("ADODB.Connection")

$sqlCon.Open("DRIVER={SQL Server};SERVER=10.224.72.184;DATABASE=ORADCTM;UID=scott;PWD=tiger")

if @error Then

MsgBox(0, "ERROR", "Failed to connect to the database")

Exit

Else

MsgBox(0, "Success!", "Connection to database successful!")

EndIf

I am getting the following error : The requested action with this object has failed

My database name is ORADCTM

server to which i am connecting is 10.224.72.184

Pls help me out in the issue.....

Share this post


Link to post
Share on other sites
Baloven

CODE
$sqlCon = ObjCreate("ADODB.Connection")

$sqlCon.Open("DRIVER={SQL Server};SERVER=10.224.72.184;DATABASE=ORADCTM;UID=scott;PWD=tiger;")

if @error Then

MsgBox(0, "ERROR", "Failed to connect to the database")

Exit

Else

MsgBox(0, "Success!", "Connection to database successful!")

EndIf

hhhmmm...

Probably does not suffice '; ' (has allocated red)

I use #include <_sql.au3>

Edited by Baloven

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  

×