Working with CDaoDatabase over IP connection?

Working with CDaoDatabase over IP connection?

Post by Jim Dunavan » Fri, 10 Jan 2003 06:49:45



Hello All,

I have a database program using CDaoDatabase and related classes. Ordinarily
we open the database by accessing the database file on disk, either locally
or over a network. Our Open call looks like this:

m_pDatabase->Open(pApp->m_pcOptions->m_strDBLocation); // File version

Now we have a customer thats need to connect his stations to the database
via an IP address. I have the desktop version of SQL Server installed on my
development machine for testing. The Open call now looks like this:

m_pDatabase->Open("fp32net",FALSE,FALSE,"ODBC"); // IP version

This works fine. The problem I'm having is that I can't open the record sets
(derived from CDaoRecordset) when using this second method (IP) of accessing
the database. In the "file" version, something like:

m_pDBRPeriodontal->Open();

works. For the IP version, this doesn't work. The SQL server seems to reject
the default SQL string.

It is ~neccessary~ that I open the record sets as type dbOpenTable, but I
don't know what SQL string to use. I know for certain that the database
itself is open, I just can't access the tables.

UPDATE:

I've also tried this method:

CDaoTableDef *defPerio = new CDaoTableDef(m_pDatabase);
..
defPerio->Open("Periodontal");
..
m_pDBRPeriodontal->Open(defPerio);

But this doesn't work either. I get an CDaoException thrown: "Invalid
Argument"

Any help will greatly appreciated.

Thanks in advance,

// Jim

--
Jim Dunavant
Programmer

www.floridaprobe.com
Florida Probe Corporation
3700 NW 91st Street, C-100
Gainesville, FL 32606
352-372-1142