|
-
Oct 31st, 2000, 05:39 AM
#1
Thread Starter
New Member
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
-
Oct 31st, 2000, 10:05 AM
#2
Addicted Member
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
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
|