Jump to content
Sign in to follow this  
tamagogi

HElp with query in Sql server

Recommended Posts

tamagogi

Hi, I have a problem inside a query with sql server. When i execute and i success with data then all right. When the query have no data has result my project crash. I use this code:

$conn = ObjCreate("ADODB.Connection")

$DSN = "DRIVER={SQL Server};" & "SERVER=XX.XX.XX.XX\SQLEXPRESS;DATABASE=Test;UID=SA;PWD=password;"

$rs = ObjCreate("ADODB.RecordSet")

$conn.Open($DSN)

$rs=$conn.EXECUTE("SELECT * from table where ....")

if $rs.RecordCount<>0 Then

MsgBox(1,"Found",$rs.Fields("value").Value)

EndIf

$rs.close

$conn.close

error is:

The requested action with this object has failed.:

$hQuery = $hConHandle.Execute($vQuery)

$hQuery = $hConHandle.Execute($vQuery)^ ERROR

thanks and sorry for my english

Share this post


Link to post
Share on other sites
ChrisL

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.