|
阅读:1343回复:5
求助!!!!!!!
Public cs As Connection
Public rbj As Recordset Private Sub Cmdclr_Click() Dim i% For i = 0 To 4 Txtclass(i).Text = "" Next i End Sub Private Sub Cmdfind_Click() Dim condition As String If Txtclass(0) <> "" Then condition = condition & "编号 = " & Txtclass(0) & " and " End If If Txtclass(1) <> "" Then condition = condition & "班级名称 like '%" & Txtclass(1) & "%'and " End If If Txtclass(2) <> "" Then condition = condition & "人数 = " & Txtclass(2) & "and " End If If Txtclass(3) <> "" Then condition = condition & "班主任 like '%" & Txtclass(3) & "%'and " End If If Txtclass(4) <> "" Then condition = condition & "教室 = " & Txtclass(4) & "and " End If Set rtemp = New Recordset If condition <> "" Then condition = Trim(Left(condition, Len(condition) - 4)) rtemp.Open "select*from 班级表 where " & condition & "", cs, adOpenKeyset, adLockPessimistic Else rtemp.Open "select * from 班级表", cs, adOpenKeyset, adLockPessimistic End If Set DataGrid1.DataSource = rtemp End Sub Private Sub Form_Load() Set cs = New Connection cs.Open "Provider=MSDASQL.1;Persist Security Info=False;Extended Properties=DBQ=" & App.Path & "\db1.mdb;DefaultDir=" & App.Path & "\listview;Driver={Driver do Microsoft Access (*.mdb)};DriverId=25;FIL=MS Access;FILEDSN=" & App.Path & "\listview\表.dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;" Set rbj = New Recordset rbj.Open "select * from 班级表", cs, adOpenKeyset, adLockPessimistic Set DataGrid1.DataSource = rbj End Sub 我得这个数据库程序用vb6.0做的界面,access做的数据库,为什么在vb设计程序中运行没问题,但是生成exe文件后,启动exe文件后就提示:[microfoft][ odbc microsoft access driver ]找不到文件"(未知的)" |
|
|
|
1C#
发布于:2006-09-19 13:49
Re:求助!!!!!!!
不知道...完毕 |
|
|
|
2C#
发布于:2006-09-19 18:00
Re:求助!!!!!!!
他不是说了找不到驱动行。。。GOOGLE吧 |
|
|
|
3C#
发布于:2006-09-19 18:04
Re:求助!!!!!!!
我总觉得楼主的错误报告没贴全。。。 |
|
|
|
4C#
发布于:2006-09-19 18:06
Re:求助!!!!!!!
推测是找不到你的ACCESS数据文件~或者是某个驱动文件之类的~ |
|
|