如何创建带密码的数据库 为解决结贴
如何创建带密码的数据库 带码如下:if not FileExists($datadir) Then
$newMdb = ObjCreate("ADOX.Catalog")
$newMdb.Create("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $datadir)
$newmdb.ActiveConnection.Close;建数据库
$addtbl = ObjCreate("ADODB.Connection")
$addTbl.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $datadir)
$addTbl.Execute("CREATE TABLE " & $Table)
;$addTbl.Execute("CREATE TABLE " & $Table1)
$addtbl.Close;建表
$addfld = ObjCreate("ADODB.Connection")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $datadir)
$addfld.Execute("ALTER TABLE " & $Table & " ADD id identity(1, 1) primary key, Name char,zm char, Singer char, Album char, url char");id identity(1, 1) primary key为自动编号和主键
;$addfld.Execute("ALTER TABLE " & $Table1 & " ADD id identity(1, 1) primary key,Name char ,zm int ,Singer char,Album char,url char")
$addfld.Close;建列表名
MsgBox(64,"提示","建立数据库成功",5)
Else
MsgBox(64,"提示","你已经建立了一个数据库了",5)
EndIf
EndSwitch
WEnd
EndFunc
[ 本帖最后由 qq82015930 于 2009-2-24 18:49 编辑 ] 顶个,我也正遇到这个问题,期待高手们的指点啊:face (37): 已搞定,兄弟,将Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $datadir)改为Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $datadir & ";Jet Oledb:Database Password=123")即可搞定!!
页:
[1]