Old Access (.mdb)
Posted: Fri Aug 31, 2012 12:36 pm
You can do the same for Access 2000 (. Mdb) ?
Code: Select all
Function makeObjectTable(pFormName As String, pNewTable As Boolean)
...
'DoCmd.RunSQL "INSERT INTO nuObjects (ob_form, ob_name, ob_type, ob_label, ob_top, ob_left, ob_primary, ob_foreign, ob_datatype, ob_tabindex) VALUES (" & Join(V, ",") & ")"
strSQL = "INSERT INTO nuObjects (ob_form, ob_name, ob_type, ob_label, ob_top, ob_left, ob_primary, ob_foreign, ob_datatype, ob_tabindex) VALUES (" & Join(V, ",") & ")"
CurrentDb.Execute strSQL
...
Code: Select all
Function buildTableSQL(pTableName As String) As String
...
'==========INSERT RECORDS
Dim rst As DAO.Recordset, atLeastOneRecord As Boolean
ReDim RW(0 To 0) As String
...
Function addForm(pAccessFormName As String)
...
'----add browse fields
Dim rst As DAO.Recordset, rCount As Integer
...
Function buildFormObjects(pFormID, pAccessFormName As String, pIsSubform As Boolean)
Dim rst As DAO.Recordset, rCount As Integer
...
Code: Select all
Private Sub write_to_file()
Const ForReading = 1, ForAppending = 8
Const TriStateUseDefault = -2, TriStateTrue = -1, TriStateFalse = 0
'
Set fs = CreateObject("Scripting.FileSystemObject")
pPath = InputBox("Save To :", , "c:\" & Format(Now(), "hhnnss") & ".sql")
Set A = fs.CreateTextFile(pPath, True)
A.Close
'Open pPath For Output As #1
Set A = fs.opentextfile(pPath, ForAppending, TriStateUseDefault)
build_tables
build_reports
build_forms
SQLstring = SQLstring & vbCrLf & "DROP TABLE IF EXISTS nu_temp_table;" & vbCrLf
SQLstring = SQLstring & vbCrLf & "CREATE TABLE nu_temp_table (nu_temp_table_id text(100), ntt_code text(100), ntt_description text(100));" & vbCrLf
SQLstring = SQLstring & vbCrLf & "DELETE FROM nu_temp_table;" & vbCrLf
SQLstring = SQLstring & vbCrLf & "INSERT INTO nu_temp_table (nu_temp_table_id, ntt_code, ntt_description) VALUES ('1234', 'unknown table name', 'unknown table name');" & vbCrLf
'Print #1, SQLstring
A.Write SQLstring
'Close #1
A.Close
Exit Sub
ErrorHandler:
MsgBox vbObjectError
End Sub