473,396 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

problems with DSN for MS Acess database

Hi!
I'm looking for some help in fixing my screwup:

I've got C++ app which reads MDB database, using MFC CDatabase and
CRecordset derived classes. I had it working OK on development PC (Win
XP SP2) with MS Access 2000 installed (the app itself does not use MS
Access). I moved the app on another PC (also Win XP SP2) without MS
Access. After some poking around I've figured out that the app does not
work because DSN it is using was not available. So I created System DSN
for MS Access Database by hand and my app was working OK.

After that by silly mistake User DSN for MS Access Database was created
on the development PC (the one with existing and working MS Access).
This upset performance of database access very badly - it takes very
long time to read and move through the records.
I've (1) unrolled XP to earlier date, (2) reinstalled MS Access - still
have the problem.

MS Access itself seems to be OK, no noticeable degradation of speed,
but CDatabase.Open and ExecuteSQL, CRecordset::MoveFirst MoveNext, etc
take very long time. It also looks like increased disk activity during
those operations.

So, any hints on what's going on and how stop it from going on like
that?

Many thanks
kdv09

Dec 20 '05 #1
14 2256
Sky
<kd***@excite.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
....
After that by silly mistake User DSN for MS Access Database was created
on the development PC (the one with existing and working MS Access).
This upset performance of database access very badly - it takes very
long time to read and move through the records


You could check the Advanced parameters in the ODBC setup.

Or you could extract the registry entries and compare them between the two
computers. To do this, open RegEdit and look at the keys for:

[HKEY_CURRENT_USER\SOFTWARE\ODBC\ODBC.INI\YourOdbcD sN]

if it is a User DSN,

or

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\YourOdbc DsN]

if it is a System DSN.

You can use RegEdit File Export to save text files for these keys and
compare the results.

If you have both User and System DSN, the User DSN wins, when you connect in
C++ using ODBC.

One parameter to check is buffer size, located at:

[HKEY_CURRENT_USER\SOFTWARE\ODBC\ODBC.INI\YourOdbcD sN\Engines\Jet]
"MaxBufferSize"=dword:00008000 ; or whatever size you want

- Steve
Dec 20 '05 #2
On 19 Dec 2005 21:02:12 -0800, kd***@excite.com wrote:
Hi!
I'm looking for some help in fixing my screwup:

I've got C++ app which reads MDB database, using MFC CDatabase and
CRecordset derived classes. I had it working OK on development PC (Win
XP SP2) with MS Access 2000 installed (the app itself does not use MS
Access). I moved the app on another PC (also Win XP SP2) without MS
Access. After some poking around I've figured out that the app does not
work because DSN it is using was not available. So I created System DSN
for MS Access Database by hand and my app was working OK.

After that by silly mistake User DSN for MS Access Database was created
on the development PC (the one with existing and working MS Access).
This upset performance of database access very badly - it takes very
long time to read and move through the records.
I've (1) unrolled XP to earlier date, (2) reinstalled MS Access - still
have the problem.

MS Access itself seems to be OK, no noticeable degradation of speed,
but CDatabase.Open and ExecuteSQL, CRecordset::MoveFirst MoveNext, etc
take very long time. It also looks like increased disk activity during
those operations.

So, any hints on what's going on and how stop it from going on like
that?

Many thanks
kdv09


Did you accidentally turn SQL logging on for the DSN?
Dec 20 '05 #3
Sheesh, this could be it! As a matter of fact I do have it on at the
moment - trying to figure out what's wrong. I'll check this first thing
tomorrow when I get back to the PC in question!
Logging would slow down all DB operations for sure, so this is a very
good guess!!!
Many thanks
kdv09
Steve Jorgensen wrote:
On 19 Dec 2005 21:02:12 -0800, kd***@excite.com wrote:
Hi!
I'm looking for some help in fixing my screwup:

I've got C++ app which reads MDB database, using MFC CDatabase and
CRecordset derived classes. I had it working OK on development PC (Win
XP SP2) with MS Access 2000 installed (the app itself does not use MS
Access). I moved the app on another PC (also Win XP SP2) without MS
Access. After some poking around I've figured out that the app does not
work because DSN it is using was not available. So I created System DSN
for MS Access Database by hand and my app was working OK.

After that by silly mistake User DSN for MS Access Database was created
on the development PC (the one with existing and working MS Access).
This upset performance of database access very badly - it takes very
long time to read and move through the records.
I've (1) unrolled XP to earlier date, (2) reinstalled MS Access - still
have the problem.

MS Access itself seems to be OK, no noticeable degradation of speed,
but CDatabase.Open and ExecuteSQL, CRecordset::MoveFirst MoveNext, etc
take very long time. It also looks like increased disk activity during
those operations.

So, any hints on what's going on and how stop it from going on like
that?

Many thanks
kdv09


Did you accidentally turn SQL logging on for the DSN?


Dec 20 '05 #4
Thanks, Steve - i'll verify this as soon as I'm back to work tomorrow!
BTW, Is there any way to check and create DSNs programmatically (I had
a cursory look only and could not find anything yet)?
regards
kdv09

Dec 20 '05 #5
kd***@excite.com wrote in
news:11**********************@g49g2000cwa.googlegr oups.com:
i'll verify this as soon as I'm back to work tomorrow!
BTW, Is there any way to check and create DSNs programmatically (I
had a cursory look only and could not find anything yet)?


Can't you do DSN-less connections? Google the term.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Dec 20 '05 #6
Sky
<kd***@excite.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
Thanks, Steve - i'll verify this as soon as I'm back to work tomorrow!
BTW, Is there any way to check and create DSNs programmatically (I had
a cursory look only and could not find anything yet)?
regards
kdv09


You can directly write the ODBC registry entries using standard Windows API
from C++. Or you can write to the registry in your installer program (I
recommend InnoSetup).

Or, you can use RegEdit File Export to create a .reg file, fix it up the way
you want it in Notepad, and then in your C++ program Shell out to add the
..reg file. The Shell command would be something like:
RegEdit /S MyOdbcSetupl.Reg

- Steve

Dec 20 '05 #7
Yep, the problem was in activating logging, rather than in DSN itself!
many thanks for your help
kdv09

kd***@excite.com wrote:
Sheesh, this could be it! As a matter of fact I do have it on at the
moment - trying to figure out what's wrong. I'll check this first thing
tomorrow when I get back to the PC in question!
Logging would slow down all DB operations for sure, so this is a very
good guess!!!
Many thanks
kdv09
Steve Jorgensen wrote:
On 19 Dec 2005 21:02:12 -0800, kd***@excite.com wrote:
Hi!
I'm looking for some help in fixing my screwup:

I've got C++ app which reads MDB database, using MFC CDatabase and
CRecordset derived classes. I had it working OK on development PC (Win
XP SP2) with MS Access 2000 installed (the app itself does not use MS
Access). I moved the app on another PC (also Win XP SP2) without MS
Access. After some poking around I've figured out that the app does not
work because DSN it is using was not available. So I created System DSN
for MS Access Database by hand and my app was working OK.

After that by silly mistake User DSN for MS Access Database was created
on the development PC (the one with existing and working MS Access).
This upset performance of database access very badly - it takes very
long time to read and move through the records.
I've (1) unrolled XP to earlier date, (2) reinstalled MS Access - still
have the problem.

MS Access itself seems to be OK, no noticeable degradation of speed,
but CDatabase.Open and ExecuteSQL, CRecordset::MoveFirst MoveNext, etc
take very long time. It also looks like increased disk activity during
those operations.

So, any hints on what's going on and how stop it from going on like
that?

Many thanks
kdv09


Did you accidentally turn SQL logging on for the DSN?


Dec 20 '05 #8
Cool! I was just thinking there might be some API like CreateDSN or
something. But distributing and importing reg file with installation is
OK
Thank you for your help
kdv09

Dec 20 '05 #9
David,
thanks for the suggestions! As a matter of fact, I had no particular
preference, just used some code from example i saw somewhere and it
worked. But now, after you've mentioned the issue I can see that using
DSN might be somewhat limiting in my application and DSN-less
connection could be a bettter choice - I will investigate and try to
use DSN less connection
Many thanks
kdv09

Dec 20 '05 #10
Sky
<kd***@excite.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Cool! I was just thinking there might be some API like CreateDSN or
something. But distributing and importing reg file with installation is
OK
Thank you for your help
kdv09


I believe the ODBC library does have functions to create DSNs at run time,
but I have never used them. I find it easer to simply write to the registry.
And if you use a static ODBC connection that does not change, then it is
easier to make the ODBC setup part of your install procedure, not part of
your program itself.

- Steve
Dec 20 '05 #11
Sky
<kd***@excite.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
David,
thanks for the suggestions! As a matter of fact, I had no particular
preference, just used some code from example i saw somewhere and it
worked. But now, after you've mentioned the issue I can see that using
DSN might be somewhat limiting in my application and DSN-less
connection could be a bettter choice - I will investigate and try to
use DSN less connection
Many thanks
kdv09


My understanding was that this is an existing C++ program that calls the
standard ODBC library directly, not the ADO interface and not an Access
application with table links.

- Steve

Dec 20 '05 #12
In message <11**********************@g14g2000cwa.googlegroups .com>,
kd***@excite.com writes
Hi!
I'm looking for some help in fixing my screwup:

I've got C++ app which reads MDB database, using MFC CDatabase and
CRecordset derived classes. I had it working OK on development PC (Win
XP SP2) with MS Access 2000 installed (the app itself does not use MS
Access). I moved the app on another PC (also Win XP SP2) without MS
Access. After some poking around I've figured out that the app does not
work because DSN it is using was not available. So I created System DSN
for MS Access Database by hand and my app was working OK.


I notice you got the problem fixed. Other people working with file DSNs
may like to know that the File DSN is a simple text file that can be
hand-edited if necessary. The only problem is that they appear to use
UNIX style line-end codes, so Notepad and other text editors can't edit
them. But Wordpad can edit UNIX text files and so can be used to edit a
File DSN.

--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author.

Dec 21 '05 #13
"Sky" <sk*@NOSPAMstanleyassociates.com> wrote in
news:LK0qf.42497$eI5.3953@trnddc05:
<kd***@excite.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
David,
thanks for the suggestions! As a matter of fact, I had no
particular preference, just used some code from example i saw
somewhere and it worked. But now, after you've mentioned the
issue I can see that using DSN might be somewhat limiting in my
application and DSN-less connection could be a bettter choice - I
will investigate and try to use DSN less connection


My understanding was that this is an existing C++ program that
calls the standard ODBC library directly, not the ADO interface
and not an Access application with table links.


I don't know anything about C++, but many programming environments
have db libraries that would allow DSN-less connections. However,
the only ones I know about are much further from the metal than C++.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Dec 21 '05 #14
kd***@excite.com wrote in
news:11**********************@g44g2000cwa.googlegr oups.com:
But distributing and importing reg file with installation is
OK


Might not work on a machine with the registry permissions locked
down. You could probably avoid that by making sure the registry
entry you write is in the current user hive, and not in local
machine (which would be accessible only to users running with
administrative permissions, or with custom registry permissions that
allow users to write to it).

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Dec 21 '05 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Randall Perry | last post by:
I've got an app written with Access XP that was deployed 2 years ago using a PostgreSQL backend database through an internet connection. Recently a client upgraded to XP Service Pack 2. After the...
2
by: Rodrigo Ferreira | last post by:
How can i interligate my app with a DB in MS Acess? I don't know how to do that! Greetings.
0
by: minhadd | last post by:
Hello Would Anyone help me ?? I want insert into Microsoft Acess visitor's IP by ASP. But It is not working ...
5
by: Islamegy® | last post by:
In my project i have two master page which i change dynamic in runtime.. The first one with 1 ContentPanel "onepanel.master", the second with 2 contentPanel"twopanel.master".. but when i switch...
0
by: Pk | last post by:
Hi, I want to download and upload the data from acess database into excel file or from excel to database. So how can i use "Excel.Application" to do this type of job. So please help me soon. ...
2
by: sonasiva | last post by:
hai Iam creating my own website using ASP and MS ACESS ,iam new to ASP and SQL Please help me to write a query to finish my project. i have datas as follows in my database sno name ...
1
by: Biji | last post by:
Help to Covert MS Acess Data Base tO SQL Server Database
1
by: =?Utf-8?B?Sm9obiBDbGVubmV0dA==?= | last post by:
We are experiencing timeout problems with 2 of the reports on our website at present. Basically what is happening is , we have a request to the SQL Server database to run a stored procedure to...
2
by: Jason7899 | last post by:
hi, there is any way to recover deleted records from a acess database? thanks a lot for your help )
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.