public sub access_getactiveconnection(theaccessfile)
the_adox.ActiveConnection="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & theaccessfile
end sub
public sub create_mdb(DBPath)
the_adox.Create "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBPath
end sub
public sub create_table(tablename,fieldnames,types)
Set tbl = createobject("ADOX.Table")
tbl.Name = tablename
for i=0 to ubound(fieldnames)-1
tbl.Columns.Append fieldnames(i), types(fieldnames(i))
next
the_adox.Tables.Append tbl
set tbl=nothing
end sub
public function tablename
dim a()
dim i : i=1
for each objtab in the_adox.tables
if objtab.type="TABLE" then
redim Preserve a(i)
a(i-1)=objtab.name
' alert(objtab.type)
i=i+1
end if
next
tablename=a
end function
public function getfieldinfo(thetabname)
dim a()
set thetableadox=the_adox.tables.item(thetabname)
for i=0 to thetableadox.columns.count-1
set ttt=createobject("scripting.dictionary")
redim preserve a(i+1)
' alert(thetableadox.columns.Item(i).type)
ttt.add "name",thetableadox.columns.Item(i).name
ttt.add "type",thetableadox.columns.Item(i).type
set a(i)=ttt
set ttt=nothing
next
' alert(isArray(a))
getfieldinfo=a
end function
Private Sub Class_Terminate
set the_adox=nothing
End Sub