ADO Connection
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2010
02:24 AM
03-23-2010
02:24 AM
ADO Connection
DBInstance = "3db60a7a-6443-45ff-8ae6-d05d0d05e007"
Set AConnection = ADO.CreateADOConnection
AConnection = .CreateADOConnection
AConnection.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog="+DBInstance+";Data Source=.\eaudit"
AConnection.LoginPrompt = False
AConnection.Open
QueryText = "SELECT count(*) FROM dbo.tablename"
Set RecSet = AConnection.Execute_(QueryText)
RecSet = AConnection.Execute_(QueryText)
Getcount = RecSet.recordcount
AConnection.Close
Im not able to get the correct record count in this. I get the anser as 1 instead of 4
3 REPLIES 3
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2010
02:26 AM
03-23-2010
02:26 AM
The reason being is that you are getting 1 record back from your query consistint of the count... what you need to do is, instead of using record count, get the value from the record present of the first column.
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2010
02:53 AM
03-23-2010
02:53 AM
Thank you for your reply.
Do you know the command to retrieve the value. When i execute the same query, i dont get the column name so i cannot use
Recset.fields(colname).value
Do you know the command to retrieve the value. When i execute the same query, i dont get the column name so i cannot use
Recset.fields(colname).value
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2010
02:57 AM
03-23-2010
02:57 AM
I got it.. recset.fields(0).value
thanks..
thanks..
