General discussion


Linking VB with SQL Server

By chikukwa ·
Im trying to link VB to an SQL database.Any code samples will be welcome

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by chavdaraju In reply to Linking VB with SQL Serve ...

download the code from or

Collapse -

by HEMAL In reply to Linking VB with SQL Serve ...

To connect VB with SQL You just need few lines of codes..i'll give you hints,,

1)first define connection with passing necessary parameters
2)Then define a command or you can use an adodb connection.
3) If you use command, write following lines
with cmdXYZ
.active connection = 'your connection"
.command type = 'stored procedure' or 'string'
.command text = 'name of sp' or 'string query'
dim rs as new adodb.recordset
rs.recordset = .execute
END with

all the best

Collapse -

by toanisht In reply to Linking VB with SQL Serve ...

1. Create a Data Source Name (DSN)
2. Select the database while you create the DSN.
3. Add reference to Microsoft ActiveX Data objects....
Open VB and the Project->References
4. Write the following code...
dim con as adodb.connection
dim rs as adodb.recordset

set con=new adodb.connection
set rs=new adodb.recordset "DSN=Name_Of_DSN"
rs. open "select * from table_name",con

set rs=nothing
set con=nothing

Collapse -

Dear Sir

by man_man In reply to Linking VB with SQL Serve ...

iam Mukund Garodhara From india
I wanto to Know about sql and vb linking
Please Guide me

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums