sensalim Posted October 29, 2007 Posted October 29, 2007 Is there a way to create a dbf (IV) file? I did a search and found one but very confusing. Was hoping someone had made Dbf.au3 (to be <include>d) and then use functions like: $a = CreateDBF( filename [, path]) AddHeader( $a, col1 [, col2, ...]) AddRow( $a, row1 [, row2, ...]) CloseDBF( $a ) or whatever. Thanks for any help.
ResNullius Posted October 29, 2007 Posted October 29, 2007 Is there a way to create a dbf (IV) file? I did a search and found one but very confusing. Was hoping someone had made Dbf.au3 (to be <include>d) and then use functions like: $a = CreateDBF( filename [, path]) AddHeader( $a, col1 [, col2, ...]) AddRow( $a, row1 [, row2, ...]) CloseDBF( $a ) or whatever. Thanks for any help.What you need are ADO functions along with a DBF COM/ODBC provider (Windows usually has dbase compatible ones installed by default). Don't think anybody's made a udf specifically for DBF yet... ... but easy enough to adapt some of the other ones that are out there for things like SQLite, etc
ptrex Posted February 8, 2008 Posted February 8, 2008 @all This is a start : ;Create RecordSet and DBF objects $ADORS = ObjCreate("ADODB.Recordset") $DBF = ObjCreate("RSConvert.DBF") ;Open table $ADORS.Open ("Orders", "DSN=ADOSamples") ;Close recordset $ADORS.Close ; Open a DB IV Database Func OpenDBFConn($Path) Local $Conn $Conn = ObjCreate("ADODB.Connection") $Conn.Open ("Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & $Path & ";" & _ "Extended Properties=""DBASE IV;"";" ) $OpenDBFConn = $Conn EndFunc regards ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
ptrex Posted February 8, 2008 Posted February 8, 2008 (edited) @all This will actually create the DBF file Const $Jet10 = 1 Const $Jet11 = 2 Const $Jet20 = 3 Const $Jet3x = 4 Const $Jet4x = 5 ;Create .DBF IV database CreateNewMDB ("\Test.dbf", $Jet4x) Func CreateNewMDB($FileName, $Format) Local $Catalog $Catalog = ObjCreate("ADOX.Catalog") $Catalog.Create ("Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Jet OLEDB:Engine Type=" & $Format & _ ";Data Source=" & @MyDocumentsDir & "\" & $FileName ) EndFunc regards ptrex Edited February 8, 2008 by ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
sensalim Posted February 8, 2008 Author Posted February 8, 2008 Yes that whitetown... I tried but it doesn't convert a column properly. This column has about 100-800 characters and the program splits it into multiple columns. I emailed them 2 days ago, no replies so far. @ptrex: I'm so green on these stuffs... what do I do with $DBF = ObjCreate("RSConvert.DBF") Sample maybe? open dbf, write a column and a row, close... Many thanks!
sensalim Posted February 8, 2008 Author Posted February 8, 2008 (edited) @all This will actually create the DBF file Const $Jet10 = 1 Const $Jet11 = 2 Const $Jet20 = 3 Const $Jet3x = 4 Const $Jet4x = 5 ;Create .DBF IV database CreateNewMDB ("\Test.dbf", $Jet4x) Func CreateNewMDB($FileName, $Format) Local $Catalog $Catalog = ObjCreate("ADOX.Catalog") $Catalog.Create ("Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Jet OLEDB:Engine Type=" & $Format & _ ";Data Source=" & @MyDocumentsDir & "\" & $FileName ) EndFunc regards ptrex Hi, It did create ... but what's in it? I can't open (view) it with excel... also how do you know all these stuffs lol... like using ADOX.Catalog... what *IS* that... Edited February 8, 2008 by sensalim
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now