Foondump. Alleen Access en geen MySQL?
Wel eens afgunstig in “fd05-mysql” gekeken?
Niet zo luxe maar werkt wel - VBScript, dumpt ‘white’ en zet ‘subscriber’ in Access, met speciaal voor zoeken vanuit TapiRex (zie hierboven) een index op kolom ‘phone’:
[code]Set sh = CreateObject(“WScript.Shell”)
path = sh.CurrentDirectory
With CreateObject(“Scripting.FileSystemObject”)
fn = path & "\white_subscriber.txt"
If .FileExists(fn) Then .DeleteFile fn
Wscript.Echo “Start dumpen …”
sh.Run “fd05-csv ““D:\Install\program files\De Telefoongids\CD-foongids\Data”” w”, 1, True
If .FileExists(fn) Then
fn = path & "\foondump.mdb"
If .FileExists(fn) Then .DeleteFile fn
Wscript.Echo "Start importeren in Access ..."
With CreateObject("DAO.DBEngine.36")
With .CreateDatabase(fn, ";LANGID=0x0409;CP=1252;COUNTRY=0", 64) 'dbLangGeneral, dbVersion40
.Execute "SELECT * INTO white_subscriber FROM [Text;Database=" & path & "].[white_subscriber.txt]"
.Execute "CREATE UNIQUE INDEX PK ON white_subscriber (id) WITH PRIMARY"
.Execute "CREATE INDEX TF ON white_subscriber (phone)"
.Close
End With
End With
Wscript.Echo "Klaar"
End If
End With[/code]
Het hele proces leunt zwaar op dit tekstbestandje, noem het (verplicht) “schema.ini”. Moet ook bij “white_subscriber.txt” in dezelfde dir staan:
[white_subscriber.txt]
ColNameHeader=False
Format=Delimited(|)
CharacterSet=ANSI
Col1=id long
Col2=title char width 40
Col3=firstname char width 128
Col4=infix char width 40
Col5=lastname char width 128
Col6=streetname char width 64
Col7=housenumber char width 24
Col8=postalcode char width 9
Col9=city char width 80
Col10=phone char width 20
Col11=category char width 5