Results 1 to 8 of 8

Thread: changing the location of the database

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2006
    Posts
    977

    changing the location of the database

    Hi
    I have a project VB6 - crystal report 9-Access Database.The database of the report was located on "C:\Employee\Employee.mdb" but the location of the database was changed into "\\PC5\Employee\Employee.mdb".How can I change the location of the database without rewriting the report?
    thanks

  2. #2
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: changing the location of the database

    simple way is that make the report using the dsn.. so where ur database the dsn automatically take the database...
    batter way is that if you are using the server client method then use the database on the server.. and make the dsn for every pc...

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2006
    Posts
    977

    Re: changing the location of the database

    simple way is that make the report using the dsn..
    where is the dsn?Can you explain more your method?
    thanks

  4. #4
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: changing the location of the database

    r u adding the database in the crystal report using the dsn or collecting the database using drive path

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2006
    Posts
    977

    Re: changing the location of the database

    I am collecting the database using drive path

  6. #6
    Frenzied Member pnish's Avatar
    Join Date
    Aug 2002
    Location
    Tassie, Oz
    Posts
    1,918

    Re: changing the location of the database

    Pete

    No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2006
    Posts
    977

    Re: changing the location of the database

    pnish I am using VB6 with CR9.
    Also I didn't catch what do u mean by n
    VB Code:
    1. Set crDB = Report.Database.Tables(1)
    2.     Set crDB = Report.Database.Tables(2)
    3.     Set crDB = Report.Database.Tables(3) ..... and so on

  8. #8
    Frenzied Member pnish's Avatar
    Join Date
    Aug 2002
    Location
    Tassie, Oz
    Posts
    1,918

    Re: changing the location of the database

    VB Code:
    1. objReport.Database.Tables(1).Location = "path & name of your database"
    If your report references more than 1 table, you need to put that line of code for each one. For example if your report referenced a table called 'Cust Names' in the database 'C:\Customers.mdb' and another table called 'Invoices' in the database 'C:\Sales.mdb' your code would look like this
    VB Code:
    1. objReport.Database.Tables([color=red]1[/color]).Location = "C:\Customers.mdb"
    2. objReport.Database.Tables([color=red]2[/color]).Location = "C:\Sales.mdb"
    The numbers in red are the table ordinals, ie they represent in which order the tables appear in your report file. You can determine this by selecting Database Expert from the Database menu in Crystal. On the right hand side all the tables used in the report will be listed, the first table is '1', the second is '2' and so on.
    Pete

    No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width