vb 6.0将数据插入到SQL Server [英] vb 6.0 insert datainto sql server
本文介绍了vb 6.0将数据插入到SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
我需要将数据插入sql server usign vb 6.0中,
我该怎么办..
如何使用连接字符串连接数据源?
请提供一些示例代码来执行此操作.
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.
推荐答案
参考:
使用Visual Basic 6中的SQL Server 2005 Express [ ^ ]
基本教程.
Refer:
Using SQL Server 2005 Express from Visual Basic 6[^]
A basic tutorial.
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>
有关连接字符串,请参见以下基于SQL Server的链接等.
http://www.connectionstrings.com/sql-server-2005 [
for connection strings, see the following link based in SQL server etc.
http://www.connectionstrings.com/sql-server-2005[^]
这篇关于vb 6.0将数据插入到SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文