|
-
Aug 29th, 2004, 05:26 PM
#15
Bah this stored procedure bs just added another load to learn... sheesh Danial i blame it all on you!
Well if only you knew the difference between Stored Proc and embeded SQL Queries, you would kill yourself for using embeded SQL query ! Before you know it you will think of upgrading to .Net 
Ok, previously what I did in order to get all rows from SQL I would do something like this:
Code:
function getTable(tblName)
{
strSQL = "SELECT * ";
strSQL += "FROM " + tblName + " ";
return this.GetRecordset(strSQL);
}
Never use Select * even if a table contain 1/2 fields. The performance difference is significant and its very bad practice.
Now, what that would do is return a recordset. So, in to call that I would simply do
objMyTable = getTable('users');
then, I would cycle through records by using objMyTable('charUsername')
Is it possible to return a recordset like this through stored procs?
Ofcourse, stored procedure uses (TSQL short for Transact SQL), it is a language in itself.
When you have a "Select ID, FirstName from Contact" in the stored procedure, that query actually is returning a Recordset which you can use in your VB.
Give me few miniute i will post a simple example of using stored procedure in VB6(havent programmed in VB6 for a while so might just take a bit more time then usual).
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|