Bret Kuhns wrote:
I recently started a co-op/internship at a company and they are
looking to migrate a large legacy supported application from OLEDB to
SQL Server. I'm doing prelim work in experimenting with the options
available. The application is huge (1+ million lines of C++ code), so
it'd be quite a bit of man hours to adapt all the database code for
SQL Server. I stumbled upon linked tables in an OLEDB file to an ODBC
source (such as SQL Server) and it appears promising as an initial
transition as it requires no code change (ideally, anyway).
I've got the table data moved to a locally running SQL Server and
linked the tables in the Access database. All the queries and table
data are working properly in Access. I launched our application with
this modified database file and the application immediately crashes
with a 0xC0000005 memory access violation. I traced the debug
information down to an assert in low-level Microsoft Foundation
Classes (MFC) code. We're using ADO (/not/ .net) in C++ as our DB
layer.
Is what I'm attempting to do possible? I've seen examples online of VB
handling linked tables in an Access database just fine, so I'm not
sure why I'm getting errors instantly. Any help would be more than
appreciated, thanks!
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
OLEDB is just a protocol to run DBs (like ODBC). IOW, OLEDB could be
used to link to SQL Server (so I don't understand your problem). The
OLEDB server provider name for SQL Server is SQLOLEDB.
If you want you can link Access (really JET db engine) tables directly
to SQL Server using the SQL Server's Linked Servers (under the Security
menu in the SQL Enterprise Manager). Then treat the Jet tables like SQL
Server tables. The reference to the tables is:
linked_server_n ame.catalog.sch ema.object_name
Ex:
AccessDB...tabl e_name
Where "AccessDB" is a name I applied when I linked the access DB to SQL
Server; and the table_name should be whatever the real table name is.
Since Access doesn't have a named catalog, nor schema name, just use the
periods (dots) without the names.
I'm suprised that they original designers of the C++ code didn't make a
class for connecting to the data source. That way all you'd have to do
is replace that class with a class that connects to SQL Server. I
believe I saw something like this on Microsoft's web site - it was
pretty cool how they compacted everything into a few classes. I believe
there is some code that you can download for these classes. Try the MSN
network.
Good luck
--
MGFoster:::mgf0 0 <atearthlink <decimal-pointnet
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBSMBn3oechKq OuFEgEQL14wCgg9 D11Th6Odmi626A0 +R/4oeRwp4AoL8O
XhEp/r8C4CtIqlUYQT34 v8Eg
=PCOo
-----END PGP SIGNATURE-----