General discussion

Locked

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 vbcodes.com or codeguru.com

Collapse -

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

Take a look at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/anch_dataaccess.asp

Collapse -

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

Hi,
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

okay,,
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

con.open "DSN=Name_Of_DSN"
rs. open "select * from table_name",con
...
...
rs.close
con.close

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