

If you're working with small result sets and/or don't mind the whole lot in memory at once, use rs.Open(strQuery, objConnection, 3) (3=adOpenStatic) and this gives a valid rs.RecordCount
#Java code to connect to database using mamp server windows
Using Windows credentials rather than supplying a user/pwd, I found an interesting diversion was discovering the subtleties of Integrated Security = true v Integrated Security = SSPI v Trusted_Connection=Yes - see Difference between Integrated Security = True and Integrated Security = SSPIīeware that RecordCount will come back as -1 if using the default adOpenForwardOnly type. Var strConn= "Provider=SQLOLEDB Data Source=server1\\dev Trusted_Connection=Yes Initial Catalog=MyDatabase " server1\dev and server1\Test which made things slightly more tricky as I managed to waste some time forgetting to escape the \ as \\ :)Īfter some dead-ends with server=server1 instanceName=dev in the connection strings, I eventually got this one to work : Our server has several instances running, e.g. I set up TestDSN and it tested OK, and then var strConn= "DSN=TestDSN" worked, so I carried on experimenting for my in-house testing and learning purposes.

connection string, but a named DSN was OK : Playing with JavaScript in an HTA I had no luck with a driver=.
