Jump to content
Sign in to follow this  
Ace08

Creating a DBF file

Recommended Posts

Ace08

Hi Guys,

I've found a simple code in vb which creates a simple dbf file after translating it to autoit making the file seems ok however I'm encountering an error "The requested action with this object has failed." when I try to Add/Append columns

Dim $tbl = ObjCreate("ADOX.Table")
Dim $cat = ObjCreate("ADOX.Catalog")
$cat.ActiveConnection = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & @ScriptDir & ";" & _
"Extended Properties=dBase III;"

$tbl.NAME = "SAMPLEDB"
$tbl.Columns.Append ("Column1", "adVarWChar")
;~ $tbl.Columns.Append ("Column2", "adInteger")
;~ $tbl.Columns.Append ("Column3", "adVarWChar")
$cat.Tables.Append ($tbl)

I was also able to check ptrex's sample however there are gibberish characters when i try to open it thru excel or scalc(Open Office)


Work smarter not harder.My First Posted Script: DataBase

Share this post


Link to post
Share on other sites
Ace08

Whew I was able to remove the error by removing "adVarWChar" from $tbl.Columns.Append ("Column1", "adVarWChar") However the header looks like "COLUMN1,C,254" anyone know why?

Edited by Ace08

Work smarter not harder.My First Posted Script: DataBase

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×