Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

execute a sql server query in VB

Status
Not open for further replies.

roswald

Programmer
Jul 6, 2002
152
US
Can anyone tell me how to execute a query that was created in sql server query analyzer (has a .qry ext) from VB.
There are multiple select statements and I don't want to create a custom stored procedure in sql server, so if I could just call this transact sql query from VB I'd be all set.
Any help would be appreciated!
 
try this

Set up your connection etc


mySQL = {cut & paste from SQL Analyzer}
rst.Open mySQL, cn, adOpenStatic, adLockOptimistic

where cn is the connection Let me know if this helps
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top