Jump to content

Database Connection error


Nachiket
 Share

Recommended Posts

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

Link to comment
Share on other sites

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