Jump to content
Sign in to follow this  

SQL syntax

Recommended Posts


$sqlCon = ObjCreate("ADODB.Connection")
$sqlCon.Open("Driver={SQL Server};Server=;Database=inventory;Uid=id_name;Pwd=password;")
$RS=$sqlCon.EXECUTE("SELECT * FROM tblClass WHERE intClassTypeId = 125")

How do I put the results of the query into a string?

Many thanks.

Edited by dazza

Share this post

Link to post
Share on other sites

You have. $RS now equals the value of the query you executed.

ConsoleWrite($RS & @CRLF)

Put that beneath the query.

This is way off.

The Execute method returns a recordset object

While Not $RS.EOF
ConsoleWrite($RS.fields("column") & @CRLF);By column name
ConsoleWrite($RS.fields(0) & @CRLF);By index

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  


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.