Login | |
|
 |
RE: Need some help with osql + sql - 10/31/2006 4:29:46 AM
|
|
 |
|
| |
kirrilian
Posts: 628
Score: 3
Joined: 3/15/2005
From:
Status: offline
|
Your first script wont work as is: - you have the instructions commented out
- strinstructions is not a variable, strInstructions = ".\inst.txt" doesnt work, you have to read the file back in. just save it as a string variable
- I am not sure about the .\ in front of osql, take that out and try again
so, objShell.run ".\osql.exe -U admin -P admin -S 10.161.55.200" '& strInstructions, 1, True would just give you a login prompt like you said. I wouldnt even mess with sendkeys at all. There are ways to connect to mssql without shelling out to osql, for example: objConnection.open "Driver={SQL Server};Server=server;Database=DB;Uid=user;Pwd=password;" query = "SELECT [column] FROM [db].[dbo].[table]" objConnection.Execute query
_____________________________
Have you searched here ? VBScript Fundamentals My Site
|
|
| |
|
|
|
|
|