vb的数据库连接这一块,谁来指点一下。谢谢
大家好?我现在想学一下vb的数据库连接这一块,由谁能指导一下,领我入门 吗?谢谢,指点一下就行
尤其是data和ado两方面!
通過OLEDB連接 Public Sub connectdb() Dim uID As String Dim userpsw As String Dim dbname As String Dim hostname As String Dim FileName
FileName = FreeFile Open App.Path + "\db.ini" For Input As FileName Input #FileName, uID, userpsw, dbname, hostname
Set cn = New ADODB.Connection cn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID= " & uID & ";Password=" & userpsw & ";Initial Catalog=" & dbname & ";Data Source=" & hostname cn.Open End Sub 請大家多多指教.