Re: question about Workspaces(0).OpenDatabase

From: david epsom dot com dot au (david_at_epsomdotcomdotau)
Date: 02/13/04


Date: Fri, 13 Feb 2004 11:12:57 +1100


>Do not know what else to do.

Yes, you should implement better exception handling or single step through
the code, so that you can see which line of code cause the first error
message, and what the parameters of that line of code are when it fails.

(david)

"rocio" <rocio.katsanis@softwareservices.net> wrote in message
news:uFujd506DHA.2480@TK2MSFTNGP12.phx.gbl...
no, I'm not having problems accessing the mdb file, or using DAO. As a test
I wrote a short VB6 program that uses the same lines of code to access the
database, as well as the same user-defined functions, and it works.

Be aware that, I have the source code and an executable for this
application. I can run the exe file in my computer. But I cannot run the exe
file in another server running only Windows 2003 server. My computer is the
one I use to develop programs loaded with VB6, Office 2000, SQL, VB.NET,
etc. While the server is only loaded with WIndows 2003 server. There are
some files/components installed in my computer that obviously are not
installed in the server and make the application failed at the server. But
what are these components?

Furthermore, in my computer, I cannot run the application from the source
code because the application uses old 3rd party controls of which I
aparently need licenses to use, and I don' have them. So when I look at the
main form in design view within VB6, I see an empty form.
I tried commenting out all the 3rd party control calls in the code just to
be able to create another exe file from it to run it in the server, and yes,
it runs in the server (I acn introduce msgbox statements here to see what
the program is doing and it is opening the database correctly)

This is why I believe there are some components/references missing in the
server that are in my computer.

Since at least can open the source code from within VB6 (code was developed
with VB5), I looked at the components/references for this application, and
copy the missing ones in the server from my computer.....still it does not
work.

Do not know what else to do.

Tx!

  "DIOS" <sindizzy.pak@softhome.net> wrote in message
news:h97Ub.177448$nt4.776786@attbi_s51...
  I would not use on error resume next. To make a directory that does not
exist simply check
  for its existence like so

  If Dir(GetImagePath, vbdirectory) = "" then MkDir GetImagePath

  I think it works if you have a directory that ends in "\" or not.

  AGP

  --

  **********************************************************************
  Unpak my email address before sending me personal email
  **********************************************************************

    "Ruskin Hardie" <RuHardie@xtra.NOSPAM.co.nz> wrote in message
news:DqVTb.33179$9k7.706662@news.xtra.co.nz...
    The reason you are getting an error of; "object required", is probably
due to the first error of 'File Not Found' showing... If you can debug the
code, trying stepping through. If the .OpenDatabase line gives you error
3024, then the issue is either with the file name of the 'mydbase.mdb' or
the 'GetDatabasePath' function... It may pay to try returning the value of;
GetDatabasePath (which I assume is a user defined function, as I am not
familiar with this as a VB or DAO function.

    Alternatively, you could temporarily hard-code the full path, in the
.OpenDatabase method and see if you have any problems.. You may also want to
check what version of DAO you are running (under 'Project', 'References'...
I think, although VB4 it may be under 'Tools'...).

      "rocio" <rocio.katsanis@softwareservices.net> wrote in message
news:OSWhTip6DHA.2572@TK2MSFTNGP09.phx.gbl...
      Please I need your help below ......

        "Roger Carlson" <NO-carlsoro-SPAM@hotmail.com> wrote in message
news:OMkktRp6DHA.1936@TK2MSFTNGP12.phx.gbl...
        This is more of a VB question than Access. You do not need Access
at all to open an Access database in VB. You DO however need a reference to
DAO (I don't know what version VB4 used) to be able to open a workspace and
database object.

        I'd try asking this on a VB Newsgroup.

        --
        --Roger Carlson
          www.rogersaccesslibrary.com
          Reply to: Roger dot Carlson at Spectrum-Health dot Org

          "rocio" <rocio.katsanis@softwareservices.net> wrote in message
news:OMqBz$o6DHA.1816@TK2MSFTNGP12.phx.gbl...
          I never developed and used Acess in the past, now I have to decode
a program written in VB4 that accesses an Access db. I installed the program
in a computer running windows server 2000 only (this is, ther is no Office
programs installed), and when I try running the code it crashes with the
message "File not Found", then another error message thta I can track from
the src code of this application.

          It seems to crash when trying to load the main form of the app,
Form_Load() . The statements here are:

              ' open the assessment number and name database
              Set dbPhotobase = Workspaces(0).OpenDatabase(GetDatabasePath &
"mydbase.mdb")
              Set rsPhotoval = dbPhotobase.OpenRecordset("photoval",
dbOpenDynaset)
              Set rsImages = dbPhotobase.OpenRecordset("images",
dbOpenDynaset)

              ' create the images directory if it does not exist
              On Error Resume Next
              MkDir Left$(GetImagePath, Len(GetImagePath) - 1)

              ' this is static
              usrCurrentImage.strPath = GetImagePath
              Exit Sub
          err_Form_Load:
              ' unload the program if the database is not accessible
              MsgBox "Could not start Photobase: " & Err.Description,
vbCritical, APP_TITLE
              End

          the error message I get (that comes from the err_Form section
above) is:
                Could not start Photobase: object required

          my guess is, since I do not have Microsoft Office installed in
this computer, maybe I'm missing some Access objects that will enable
Workspaces to open this database? Or, do I need to have Access install in
order to run this piece of code?

          Hope you can help on this one.....



Relevant Pages

  • Re: Trouble Getting VS.Net 2003 WalkThroughs MSDE Connection
    ... Config Tool of SQL Server? ... > link to download the PUBs database. ... >>> Setup and they directed me to install MSDE and they attached a ...
    (microsoft.public.sqlserver.msde)
  • Re: Sharepoint not working anymore
    ... a way to rebuild the master database (which you can think of as the database ... Microsoft Small Business Server Support ... SBS Newsgroups: ... >> You mentioned that you had set out to install SP1... ...
    (microsoft.public.windows.server.sbs)
  • Re: Multiple instances
    ... "We wrote the books on Project Server" ... >> install; one production, one demo. ... >> I first created a new project database, populated it by running setupdb, ... >> had MSProjectServerUser in the MSProjectMember Role text box under ...
    (microsoft.public.project.pro_and_server)
  • RE: SPS WSS SQL 2000 same machine
    ... that the MSSQL$SHAREPOINT SQL Service instance is not running. ... both are installed on the SQL Server Default instance. ... You MUST install WSS before SPS. ... However, when selecting the Database ...
    (microsoft.public.sharepoint.portalserver)
  • Create SharePoint Portal failed.
    ... One mentioned ensuring that SQL Server uses a case ... 13:55:40 Service database server is 'USDC-JOHRIV'. ... Update dbo.propertylist set DisplayName = N'Last name' ...
    (microsoft.public.sharepoint.portalserver)

Loading