Burthold Posted August 31, 2006 Share Posted August 31, 2006 (edited) 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.aspxTwo,I've got to map the dll functions example:http://msdn2.microsoft.com/en-us/library/ms131468.aspxRETCODE 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) EndFuncCan 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 August 31, 2006 by Burthold Link to comment Share on other sites More sharing options...
Burthold Posted August 31, 2006 Author Share Posted August 31, 2006 Ok I think I figured out that HDBC is a pointer. I'm still working on the rest. Link to comment Share on other sites More sharing options...
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