strDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=你的数据库路径
pConn.Open strDSN
解决方案 »
- 请教关于用WINSOCK监听的时候为什么需要判断INDEX
- 如何用recordset获取存储过程的数据
- 如何使插入表格的字居中
- ActiveReport 在显示 中文文章(几个段落) 时,每个段落前的缩进被忽略了,为什么?
- 有关farpoint spread 单元格的问题。
- 发布一个网络收发DLL,扔掉VB自带的Winsock吧
- 制作产品Demo的软件最好,就是把我在屏幕上的操作“录像”的软件,能记录声音就更好了。
- 一个VB组合输出的问题
- 高分寻VB.NET的名著,名家,名网?
- 如何用程序读取Outlook Express收件箱中的邮件和附件??
- 怎样把整个屏幕拷贝到剪贴板?
- Word的类名到底是什么?wnd=FindWindow("OpusApp", 0)怎么得不到它的句柄?
Option Explicit
Dim cnn As New ADODB.ConnectionPrivate Sub Form_Load()
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\xxxx.MDB;Persist Security Info=False;Jet OLEDB:Database Password=YourPassword"
Dim rst As New ADODB.Recordset
rst.Open "select * from table1", cnn, adOpenKeyset, adLockPessimistic, adCmdText
Set Me.MSFlexGrid1.DataSource = rst
End Sub
Dim rst As ADODB.Recordset
Dim cnnstr As String
Set cnn1 = New ADODB.Connectioncnnstr = " provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\test.mdb;"
cnn1.Open cnnstrSet rst = New ADODB.Recordset
rst.CursorType = adOpenKeyset
rst.LockType = adLockOptimistic
rst.Open "select * from stu", cnn1Set Form1.MSHFlexGrid1.DataSource = rstrst.Close
cnn1.Close
End Sub