求助调试出现这样的错误提示!
Public adoCon As New ADODB.Connection '定义一个数据连接Public adoRs As New ADODB.Recordset '定义一个数据集对象
Public adoRs1 As New ADODB.Recordset '定义一个数据集对象
Public bQx(1 To 24) As Boolean '权限
Public Name1 As String
Public StrNums As Integer
Public Temps '定义一个变体类型的公共变量
'声明一个API函数,用于实现使窗体置前还是取消窗体置前的功能
Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public rtn
Public CnnStr As String
Public Sub Main() '定义一个公共主函数,用于连接数据库
CnnStr = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_SPJXC;Data Source=."
adoCon.Open (CnnStr)
End Sub
调试 数据库 User ID=sa;PWD=sa的密码; 连接字符串没有密码呀.
最简单的办法是添加ADODC控件, 然后使用控件的连接功能连接测试, 然后控件可以自动生成连接字符串.
把生成的连接字符串拷贝过来即可. 方便又不会出错.
补充:VB , 数据库(包含打印,安装,报表)