Click here to Skip to main content
15,924,507 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello ,

i need to insert data into sql server usign vb 6.0 ,
how can i do this ..
how to connect datasourece using connection string?

please give some sample code to do this.
Posted

 
Share this answer
 
VB
Dim oConn As Connection
Dim oCmd As Command  
Set oConn = New Connection  
oConn.Open <your connection="" string="" goes="" here="">  
Set oCmd = New Command  
oCmd.ActiveConnection = oConn 
oCmd.CommandText = "INSERT INTO YourTable (Column1Name) VALUES('columnValue')" oCmd.Execute 
</your>

for connection strings, see the following link based in SQL server etc.
http://www.connectionstrings.com/sql-server-2005[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900