|
Hi,
I am using VB6 With SQL Server 2005.
I am using below code to populate VB6 FlexGrid and it's working perfectly.
strSQL="Select * from <TABLE NAME>"
Set Grid1.DataSource = Nothing
Adodc1.ConnectionString = cnn
Adodc1.RecordSource = strSQL
Adodc1.Refresh
With Grid1
Set .DataSource = Adodc1
End With
Now i want execute Select Statement with Stored Procedure which have input parameter also.
What should i do to Get record with Stored Procedure.
Thanks in advance.
|
|
|
|
|
Yusuf Mohammad wrote: I am using VB6 With SQL Server 2005. VB6 is deprecated; meaning it's no longer sold, no longer supported, and no longer recommended for development. You'd best upgrade to VB.NET, which happens to be "free" (VB6 isn't)
Yusuf Mohammad wrote: What should i do to Get record with Stored Procedure. Like I said, VB6 is no longer supported. Still, the first Google result[^] explains how. Points to a nice CodeProject-article
|
|
|
|
|
Thanks Eddy,
I know VB6 is no longer supported from Microsoft, but he is our Old Client and i have to do a lot of things as per your recommendation. I have to get data faster (huge and from multiple table) only on 2 forms and that's it. so please if you can help.
|
|
|
|
|
Yusuf Mohammad wrote: so please if you can help. I did; see the previous post, there's a link to a CodeProject-article that explains how to run a stored-procedure using VB6.
Yusuf Mohammad wrote: I know VB6 is no longer supported from Microsoft, but he is our Old Client
I wish your old client lots of success; if he's not migrating yet, he's setting himself up for a huge problem. Like I said, VB6 isn't for sale anymore, and newer Windows-version will not be tested with VB6 applications. There's no guarantee that any VB6-app will still work tomorrow, any update could kill it.
|
|
|
|
|
It's difficult to find documentation for this - all of the VB6 documentation on MSDN has been retired.
Looking at the .NET compatibility wrapper[^], you should have a property called CommandType , which you need to set to adCmdStoredProc (or 4 if the constant isn't defined).
I don't think there's any way to pass parameters to the query, other than using an ADODB.Command to manually execute the query and assigning the results to the Recordset property on the ADODC control.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
Why did you have to do that man.
Here we are, on a mission to rid the world of the unholy abomination that is VB6 and you just had to go dig up documentation for it.
|
|
|
|
|
I have seen the Update Statement using Stored Procedure. I haven't try that code but i think it should work. Unfortunately not able to find Select Statement using Stored Procedure.
|
|
|
|