编程论坛
注册
登录
编程论坛
→
VB.NET论坛
vb.net如何创建mdb文件并设置密码
zsdqxzxx
发布于 2017-01-30 21:15, 5109 次点击
如何创建mdb文件并设置密码,在不引用任何资源的情况下可以么?
5 回复
#2
梦幻倩影
2017-02-12 15:06
http://bbs.
#3
zsdqxzxx
2017-02-15 19:19
看过那个网页的方法,问题是他要引用ado,我是说不引用任何资源可以么?
#4
zsdqxzxx
2017-02-15 19:22
经过摸索,我是这样做的
Dim bd, cat As Object
bd = "c:\data.mdb"
cat = CreateObject("ADOX.Catalog")
cat.Create("provider=microsoft.jet.oledb.4.0;;Jet OleDb:DataBase Password=940434;data source=" + bd)
cat = Nothing
Dim connstr As String
Dim co, rs, aa As Object
co = CreateObject("ADODB.Connection")
connstr = "provider=microsoft.jet.oledb.4.0;;Jet OleDb:DataBase Password=940434;data source=" + bd
co.Open(connstr)
rs = CreateObject("Adodb.RecordSet")
aa = "CREATE TABLE yhxx(id Counter,姓名 text(255),性别 text(255))"
rs.Open(aa, co, 3, 3)
rs = Nothing
bd = Nothing
aa = Nothing
cat = Nothing
connstr = Nothing
co.close()
co = Nothing
GC.Collect()
#5
梦幻倩影
2017-02-16 09:21
co = CreateObject("ADODB.Connection")
上面的代码还不是用到了ADO吗?
#6
com34314
2017-05-23 21:02
Dim bd, cat As Object
bd = "c:\data.mdb"
cat = CreateObject("ADOX.Catalog")
cat.Create("provider=microsoft.jet.oledb.4.0;;Jet OleDb:DataBase Password=940434;data source=" + bd)
cat = Nothing
Dim connstr As String
Dim co, rs, aa As Object
co = CreateObject("ADODB.Connection")
connstr = "provider=microsoft.jet.oledb.4.0;;Jet OleDb:DataBase Password=940434;data source=" + bd
co.Open(connstr)
rs = CreateObject("Adodb.RecordSet")
aa = "CREATE www. yhxx(id Counter,姓名 text(255),性别 text(255))"
rs.Open(aa, co, 3, 3)
rs = Nothing
bd = Nothing
aa = Nothing
cat = Nothing
connstr = Nothing
co.close()
co = Nothing
GC.Collect()
1