Sign in to follow this  
Followers 0
sensalim

DBF reader and writer

4 posts in this topic

I used to use the dbf.dll made by Jerome

http://www.autoitscript.com/forum/index.ph...5308&hl=dbf

but since the last autoit release, it crashes.

In his zipped, there is a compiled exe file and it still works...

so either I go back to older autoit or find a fix to this dll...

Anyone help?

Thanks.

Share this post


Link to post
Share on other sites

#2 ·  Posted (edited)

I used to use the dbf.dll made by Jerome

http://www.autoitscript.com/forum/index.ph...5308&hl=dbf

but since the last autoit release, it crashes.

In his zipped, there is a compiled exe file and it still works...

so either I go back to older autoit or find a fix to this dll...

Anyone help?

Thanks.

This is what worked for me. Edit each DllCall() function and add ":cdecl" to the return type:

from

$resr = DllCall($dll_dbf, "int", "dbOpen", "str", $db, "str", $fname, "str", $type, "int", $password)

to

$resr = DllCall($dll_dbf, "int:cdecl", "dbOpen", "str", $db, "str", $fname, "str", $type, "int", $password)

Edited by GeoBob

Share this post


Link to post
Share on other sites

This is what worked for me. Edit each DllCall() function and add ":cdecl" to the return type:

from

$resr = DllCall($dll_dbf, "int", "dbOpen", "str", $db, "str", $fname, "str", $type, "int", $password)

to

$resr = DllCall($dll_dbf, "int:cdecl", "dbOpen", "str", $db, "str", $fname, "str", $type, "int", $password)

Finally a reply :) Thanks.

I tried but it still crashes. I think it crashes on

Func dbAddRecord($db, ByRef $FV, $nbfields)
     Redim $FV[$nbfields+1]
     $f=_StringRepeat("char[256];", $nbfields)
     $s = DllStructCreate($f)
     if @Error then return ErrorDBF("dbAddRecord", $ERR_NOMEMORY)
     For $i=1 to $nbfields
         DllStructSetData($s, $i, $FV[$i-1])
     Next
     $resr = DllCall($dll_dbf, "int:cdecl", "dbAddRecord", "str", $db, "ptr", DllStructGetPtr($s))
     if $resr[0] < 0 Then 
         DllStructDelete($s)
         return ErrorDBF("dbAddRecord", $resr)
     EndIf
     For $i=1 to $nbfields
        $FV[$i-1] = DllStructGetData($s,$i)
     Next
     DllStructDelete($s)
     return 0;
EndFunc

dbCreate() and dbAddField() do not seem to crash.

So what now?

Thanks.

Share this post


Link to post
Share on other sites

Post to learn and follow this post.

Really many talk about many possibilities of autoit that don't develop.

I don't find enough and functional examples in au3 of Planning agendas with Autoit, or invoice program, or manipulating database utilities.

Best Regards


Traducción AutoIt al Español. http://autoitespa.espanaforo.com/forum.htm . Visita el foro de AutoIt en español http://www.emesn.com/autoitforum/. I am a simple user, not a programmer.

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  
Followers 0