Problem with put_Location in 4.9 ADK
Chris Jones
cjones at daz3d.com
Wed Apr 4 09:49:48 CDT 2012
Hi,
I'm upgrading some code using C++ ADK on Windows from 4.8 to 4.9, however I
keep getting an error: "%S" invalid database name. I am using the exact
same code in 4.8 and it works great.
....
m_data->m_vDB = m_data->m_splDB->get_BaseDatabase();
String dbNameStr = toString( dbName ); //dbName is set above
I_Location_Ptr dbLocation = new Location( &dbNameStr );
m_data->m_vDB->put_Location( dbLocation );
I_Server_Ptr server = CreateServer(m_data->m_dbCon);
I_DatabaseInfo_Ptr info = server->get_DatabaseInfo(dbNameStr);
if( !info )
{
m_data->m_vDB->put_BigEndian(false);
m_data->m_vDB->put_Mode(kDsc_Dat_Blb_Ind);
I_Localizable_Ptr local = QUERY_INTERFACE(m_data->m_vDB, I_Localizable);
if(local)
{
local->put_CollationAttribute(UCOL_STRENGTH,UCOL_SECONDARY);
}
try {
m_data->m_vDB->Create();
m_data->m_vDB->put_SchemaVersion( ValentinaSchemaVersion );
}
catch (xException& cErr) {
if(cErr.get_ErrorCode()!=fbl::ERR_CONNECTION_DATABASE_ALREADY_EXISTS)
{
throw;
}
}
}
...
if(!m_data->m_vDB->get_IsOpen())
{
m_data->m_vDB->Open();
}
When the database already exits the info returns correctly, but open never
succeeds. What am I doing wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macserve.net/pipermail/valentina/attachments/20120404/2ac0225e/attachment.html>
More information about the Valentina
mailing list