Jump to content

Recommended Posts

Posted

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

Posted

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.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...