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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Working with MSSQL Views... ?

Status
Not open for further replies.

xluryan

Programmer
Apr 29, 2009
1
US
I run a query on a regular MSSQL table and it returns a RecordSet just fine. However, when I try to query a "view", I only ever get an empty RecordSet. Any help?

Code:
Dim DB : Set DB = CreateObject("ADODB.Connection")
Dim RS : Set RS = CreateObject("ADODB.RecordSet")
Dim sQuery

DB.Open CONNECTION_STRING
sQuery = "SELECT * FROM SampleView"
RS.Open sQuery, DB, 3, 3, 1

RS.RecordCount always == -1.
 
>RS.RecordCount always == -1.
Cannot confirm this if the SampleView has been created and is existing. It would response as if it is a table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top