Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / DB Engine / SQL Server / March 2008

Tip: Looking for answers? Try searching our database.

Replace OpenDatabase with?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Maury Markowitz - 25 Mar 2008 18:54 GMT
I have a MDB that consists largely of a number of linked tables to
external data files, which contain various activity data. I then open
this db from my ADP project using OpenDatabase and OpenRecordset,
which I believe are based on DAO (are they?).

I am in the process of attempting to remove all DAO code from the ADP.
I have never used ADODB to open an MDB, however, and I was wondering
if anyone has a few pointers? It's pretty simple code...

   'open the file via the linked table in the mdb, and check the date
inside it
   Set db = OpenDatabase("L:\Tools\Reconciliation
\Reconciliation.mdb")
   Set act = db.OpenRecordset("Activity")
   startDate = CDate(act.fields(1))

I'm hoping this can be converted to something using ADOBD and
connection strings. I'm pretty familiar with these, but they seem to
be extremely fragile so any advice to start would be great!

Maury
Dave Patrick - 26 Mar 2008 03:27 GMT
Dim cnn As ADODB.Connection

  Set cnn = CurrentProject.Connection
  'Do some stuff here
  cnn.Close
  Set cnn = Nothing

Signature

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

>I have a MDB that consists largely of a number of linked tables to
> external data files, which contain various activity data. I then open
[quoted text clipped - 17 lines]
>
> Maury
Maury Markowitz - 26 Mar 2008 14:31 GMT
On Mar 25, 10:27 pm, "Dave Patrick" <DSPatr...@nospam.gmail.com>
wrote:
>    Dim cnn As ADODB.Connection
>
>    Set cnn = CurrentProject.Connection
>    'Do some stuff here
>    cnn.Close
>    Set cnn = Nothing

Ummm, no.

Maury
Dave Patrick - 27 Mar 2008 03:46 GMT
That's very descriptive!

Signature

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

Ummm, no.

Maury
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.