vb连接数据库问题
VB code:
Set g_conn = Server.CreateObject("ADODB.Connection")
Dim ServerName As String, DBname As String, UserName As String, strPwd As String
Dim strDBPath As String
ServerName = "localhost"
DBname = "题库"
UserName = "sa"
strPwd = ""
strDBPath = App.Path & "\题库.mdb"
With g_conn
'If DBType = DBAccess Then
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Password='';" & "Data Source =" & _
strDBPath '(为什么这一行有错?)
'Else
'连接SQLServer
'.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=True;" & _
' "User ID=" & UserName & ";Initial Catalog=" & DBname & _
' ";Data Source=" & ServerName & ";pwd=" & strPwd
'End If
.Open
End With
为什么ConnectionString那一行有错呢?
这段没错。
(回复内容太短了! )
是 VBA 代码??????????????????????
Server是个什么东西?
相关问答:
本人使用的是VB6.0版本
假设有一个对象A,A内有类型为B的对象属性。现在的问题是,需要添加若干个B对象作为A对象的属性。如,
A.B1,A.B2,...
但具体添加多少个B对象作为A对象的属性则视具体情况不同而不同 ......
刚接触vb6.0,有些摸不到的感觉,敬请各位大虾给点建议!!!
不会吧,推荐学习.NET。顺便推荐实用代码网站http://bingning.net/free/source/index.html。
如果没基础 就用易语言吧 中文编程呢 代码都是中文 ......
为什么我用form.show和form.hide多次连接了两个窗口只能互换链接两次啊?
代码看看
照道理form.show 没次数限定的吧
我也快疯了。
楼主知道怎么发贴么?
引用
我也快疯了。
楼主知道怎么发贴么?
楼主也 ......
在网上下载了speechsdk51LangPack安装后,用vb可以发音(中文),里面有个girl xiaokun的发音,对中文很好听。但是这个speechsdk51LangPack有100多M,我的vb项目打包后,怎么才可以装到其他机子上也能用??总不能每 ......
Private Sub btnPrint_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPrint.Click
MouseWait()
Dim ClearTempTabelSQL As String
'If Not ......