Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default DAO Late Binding?

Hi, Guys :) I try not to visit here too often (you have
enough work to do), but I'm stumped.

I am currently building a turnkey 2002 Excel application
that needs to pull, each time the workbook file is
loaded, a small number (600) of records out of a
potentially large (200,000+) c: drive database (which is
populated locally via VBA from a website Excel
spreadsheet export). A variety of customized reports,
charts, and data crunching will result from each file
load, so I'm all right with working with Excel for this.

The database is going out to a large number (3000+) of
strangers all over the country, most of whom aren't
particularly familiar with Excel.

I wish there was an easier way to do this, but I'm locked
in (the Access Application isn't available to the users
in question). VB isn't an option, either, due to time
restraints and the software development requirements for
the company I work for. In general, this is a very
customized (but robust) project and this one item is the
only real thing keeping me from getting it done.

I am pointing in the direction of a DAO Late-Bind
connection (to sidestep the necessity of teaching 3000
people how to set up a Reference).

First, is DAO Late-Bind the correct choice, or is there
an easier way to do this?

I managed to build the database and workspace connections
with an early bind, but as soon as I change everything to
generic Objects to do a Late-Bind, it chokes on the
CreateDatabase string (to initialize an empty project if
the database doesn't already exist).

Would anyone happen to have an example of a working DAO
Late-Bind? DIM statements, a DB creation string, a
Workspace creation string, and a CreateDatabase string is
all I need, really. I'm pretty sure I can take it from
there.

I spent all night on the Internet, and then looked
through every single reference book I could get my hands
on (and I have a lot of 'em).

If necessary, I'll bring in a copy of my DB-related code
from work, but I'm writing this post from home and don't
have it with me.

Thanks for all your help.

-D

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default DAO Late Binding?

Are you using any constants in your createdatabase expression. (such as

Set nWindEx = Workspaces(0).CreateDatabase(Application.Path _
& "\NWINDEX.MDB", dbLangGeneral) ' dbLangGeneral would be "" rather than
its early bound defined value of ";LANGID=0x0409;CP=1252;COUNTRY=0" (at
least that is its value on my machine).

or perhaps you use the createworkspace method that also uses a constant

when you late bind, these constants are empty variables - they are not
defined constants anymore. The will be interpreted as having value of zero
(for longs, or null string for strings). this is a common problem people
overlook when using latebinding - this would be particularly true in your
case where you used early binding to do the development and are switching to
late binding. You need to hard code values where you have constants. (or
define the constants in your own code).

Just a thought.

--
Regards,
Tom Ogilvy



Sharqua wrote in message
...
Hi, Guys :) I try not to visit here too often (you have
enough work to do), but I'm stumped.

I am currently building a turnkey 2002 Excel application
that needs to pull, each time the workbook file is
loaded, a small number (600) of records out of a
potentially large (200,000+) c: drive database (which is
populated locally via VBA from a website Excel
spreadsheet export). A variety of customized reports,
charts, and data crunching will result from each file
load, so I'm all right with working with Excel for this.

The database is going out to a large number (3000+) of
strangers all over the country, most of whom aren't
particularly familiar with Excel.

I wish there was an easier way to do this, but I'm locked
in (the Access Application isn't available to the users
in question). VB isn't an option, either, due to time
restraints and the software development requirements for
the company I work for. In general, this is a very
customized (but robust) project and this one item is the
only real thing keeping me from getting it done.

I am pointing in the direction of a DAO Late-Bind
connection (to sidestep the necessity of teaching 3000
people how to set up a Reference).

First, is DAO Late-Bind the correct choice, or is there
an easier way to do this?

I managed to build the database and workspace connections
with an early bind, but as soon as I change everything to
generic Objects to do a Late-Bind, it chokes on the
CreateDatabase string (to initialize an empty project if
the database doesn't already exist).

Would anyone happen to have an example of a working DAO
Late-Bind? DIM statements, a DB creation string, a
Workspace creation string, and a CreateDatabase string is
all I need, really. I'm pretty sure I can take it from
there.

I spent all night on the Internet, and then looked
through every single reference book I could get my hands
on (and I have a lot of 'em).

If necessary, I'll bring in a copy of my DB-related code
from work, but I'm writing this post from home and don't
have it with me.

Thanks for all your help.

-D



  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default DAO Late Binding?

Bingo. That's exactly what's happening.

I'll take a look at it on Monday when I go back in.

Thanks, Tom. I knew you'd have an answer if nobody else
did. :)

-Donna


-----Original Message-----
Are you using any constants in your createdatabase

expression. (such as

Set nWindEx = Workspaces(0).CreateDatabase

(Application.Path _
& "\NWINDEX.MDB", dbLangGeneral) ' dbLangGeneral

would be "" rather than
its early bound defined value

of ";LANGID=0x0409;CP=1252;COUNTRY=0" (at
least that is its value on my machine).

or perhaps you use the createworkspace method that also

uses a constant

when you late bind, these constants are empty variables -

they are not
defined constants anymore. The will be interpreted as

having value of zero
(for longs, or null string for strings). this is a

common problem people
overlook when using latebinding - this would be

particularly true in your
case where you used early binding to do the development

and are switching to
late binding. You need to hard code values where you

have constants. (or
define the constants in your own code).

Just a thought.

--
Regards,
Tom Ogilvy



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Late Binding issue with Excel.Application object [email protected][_2_] Excel Discussion (Misc queries) 2 August 4th 09 08:10 AM
VB Extensibility library and "late binding" Dennis Excel Discussion (Misc queries) 0 March 30th 05 10:51 PM
Creating a MailItem in Outlook from Excel using Late Binding Steven Kelder Excel Programming 3 December 17th 03 05:34 PM
Early vs Late Binding - Word John Wilson Excel Programming 6 November 13th 03 03:21 PM
DAO objects with late binding in Excel? Chris Excel Programming 0 August 21st 03 07:28 PM


All times are GMT +1. The time now is 02:19 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"