Jump to content
Sign in to follow this  
Bendo

MS SQL data into an array...

Recommended Posts

Bendo

Hi all,

I'm trying to get a column of data from MS SQL and stick it into an array.

I've tried various solutions from the forum but I can't quite seem to crack it.

Also pretty new to all this but here is what I've got.

$sqlCon = ObjCreate("ADODB.Connection")
$sqlCon.Open("Provider=SQLOLEDB;Data Source=server;Database=master;User ID=helpdesk;Password=password;")
Global $array
$array = $sqlCon.execute("select loginname from master..syslogins WHERE isnumeric(loginname) = 1 order by loginname")
MsgBox(0,"results", $array)

No errors but no data either.

Also on the server, the login used does return data, two entries in one column.

Any cluesticks welcome...

Share this post


Link to post
Share on other sites
JoHanatCent

If the answer is an array you need to look at:

_ArrayDisplay


Share this post


Link to post
Share on other sites
ChrisL
Bendo

Thanks all,

working now... dunno I was doing some silly typo's or not having the correct syntax.

I have used bits from your examples and

is a great resource.

Thanks again.

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  

×