Jump to content
Sign in to follow this  

odbcbcp.dll via autoit3 for speed!

Recommended Posts

Ok, I've built a tool to move data from one data source to sql server. It was HORRIBLY slow using standard recordset insert and the like.

So, I moved to BCP, actually I moved to BULK INSERT statement dumping records to a file and then reading that file in. That got me a 1000000% increase there abouts.

I am shooting for the same performance or better by skipping the file creation and just using memory structures.

This brought me to the odbc api.

several things have to happen.


SQLSetConnectAttr has to be set. I really don't know how the heck I'm gonna set this thing.



I've got to map the dll functions example:


RETCODE bcp_init (

HDBC hdbc,

LPCTSTR szTable,

LPCTSTR szDataFile,

LPCTSTR szErrorFile,

INT eDirection);

I think it would map something like this:

func bcp_init($oConn,$sTable,$sDataFile,$sErrorFile,$iDirection)
$result = dllcall("odbcbcp.dll","int","bcp_init","dunno",$oConn,"str",$sTable,"str",$sDataFile,"str",$sErrorFile,"int",$iDirection)

Can someone explain how I would pass a connection aka HDBC to an autoit function?

Can I even do this in autoit or will I have to write a COM rapper around this thing to use it??

Thanks again,


Edited by Burthold

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  

  • Create New...