MyODBC w/Cocoa?
MyODBC w/Cocoa?
- Subject: MyODBC w/Cocoa?
- From: "David Piasecki" <email@hidden>
- Date: Wed, 21 Apr 2004 11:43:21 -0700
Has anyone tried using MyODBC in Cocoa? I've followed the CocoaMySQL
source before, but this time I want to use standard C++ with ODBC
instead of Objective-C so I can use the same source code on other
platforms. For some reason, the source below compiles just fine when I
#include <sql.h>, but I get the runtime error "ZeroLink: unknown symbol
'_SQLAllocEnv'". I have the libmyodbc3.bundle library included in my
project, but somehow it seems my runtime environment doesn't recognize
SQLAllocEnv. I would guess it doesn't recognize the other functions
either. I'm not sure if this is the best list to ask this question, but
it's the only one I'm familiar with at the moment.
SQLAllocEnv(&henv);
SQLAllocConnect(henv,&hdbc);
rc = SQLConnect(hdbc,(SQLCHAR *)"datasource",SQL_NTS,NULL,0,NULL,0);
// Deallocate handles and display error message
if( !MYSQLSUCCESS(rc) )
{
SQLFreeEnv(henv);
SQLFreeConnect(hdbc);
printf("Could not connect to database");
}
rc = SQLAllocStmt(hdbc,&hstmt);
David
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.