Jump to content

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.

One,

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

http://msdn2.microsoft.com/en-us/library/ms131709.aspx

Two,

I've got to map the dll functions example:

http://msdn2.microsoft.com/en-us/library/ms131468.aspx

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)
EndFunc

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,

Wes

Edited by Burthold
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...