-
Hi!
I was trying to open a SQL Server database from VB5.0.
1. Created a DSN
2. Using Opendatabase method, opened the database
3. Using Openrecordset method, i was trying to open a table in the SQL Server database
This gives an error saying,"Not a valid Stored procedure". then, i tried opening a stored procedure. But, i couldn't open a stored procedure also.
Anyone can help me to open a table(SQL Server) from VB5.0
Thanks in advance
Regards
smrenga
-
are u using ADO or RDO?
in ADO:
Code:
Dim cn as new Connection
Dim rs as new Recordset
cn.open "<your connection string goes here>"
set rs = cn.Execute("<your SQL code to retrieve a recordset goes here>")
Do While Not rs.eof
.
.<here you manipulte data on "by row" basis>
.
.
rs.MoveNext
Loop
ps. you said you want to open table: you don't open table - you open connection and get the recordset from the table.
email me if you have any questions