注册 登录
编程论坛 SQL Server论坛

求助vb与SQL SERVER数据库的连接问题

shunlai 发布于 2008-01-23 19:33, 1295 次点击
同志们好!
求助大家一个问题,就是如何用vb程序连接上SQL SERVER数据库。谢谢!最好赐教编码。 
2 回复
#2
deleter2008-01-24 19:51
public DB as new adodb.connection
dim adoTable as new adodb.recordset
dim strCnnString,strSQLCommand as String
dim modify as boolean

Private Sub Form_Load()
     '设置连接字符串
   strConnString="Provider=SQLOLEDB.1;Intergrated Security=SSPI;"_
                                &"Persist Security Info=Flase;Initial Catalog=DEmoData;"_
                                &"Data Source=(local)"
       DB.ConnectionString=strConnstring
       DB.Open strConnString,"sa"," ",-1            '打开连接
......
End Sub
#3
wgyjx2008-03-29 09:12
能说的更详细点?
1