ActualConnectionString

Posts   
 
    
BISHMAN
User
Posts: 41
Joined: 30-Jan-2010
# Posted on: 23-Jun-2010 20:32:46   

LLBLGen 3.0 selfserv

I am trying to populate a sales database in an sql server named "TEXTBOX1" with the data from a user selected ACCESS database. In the code below the user selected to populate "CLOV7Sales". I created the LLBLGen code using a database named "StoreSales".

Each store has it's own sales database, so I will have about 9 more databases such as EA10Sales, EA15Sales.

When I execute the following code the "StoreSales" database gets populated. What am I missing?

    'set then connection string based on selections
    StoreSalesDAL.DaoClasses.CommonDaoBase.ActualConnectionString = "data source=" & ComboBox1.Text & ";initial catalog=" & ComboBox2.Text & ";integrated security=SSPI;persist security info=False;packet size=4096"
    StoreSalesACCESS.DaoClasses.CommonDaoBase.ActualConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Label3.Text & ""

    Try
        'load the CustByClassByDay table
        Dim CCDc As New StoreSalesDAL.CollectionClasses.CustByClassByDayCollection
        totrecords = CCDc.GetDbCount()
        If totrecords = 0 Then
            Dim CCDac As New StoreSalesACCESS.CollectionClasses.CustByClassByDayCollection
            CCDac.GetMulti(Nothing)
            If CCDac.Count > 0 Then
                For i = 0 To CCDac.Count - 1
                    Dim CCD As New StoreSalesDAL.EntityClasses.CustByClassByDayEntity
                    CCD.StoreID = CCDac.Item(i).StoreID
                    CCD.Register = CCDac.Item(i).Register
                    CCD.SlsClass = CCDac.Item(i).SlsClass
                    CCD.SlsDate = CCDac.Item(i).SlsDate
                    CCD.CC1 = CCDac.Item(i).CC1
                    CCD.CC2 = CCDac.Item(i).CC2
                    CCD.CC3 = CCDac.Item(i).CC3
                    CCD.NumCust = CCDac.Item(i).NumCust
                    CCD.Save()
                Next
            End If
        End If

... 
            ... 
            ...

This is the result of setting the actualconnectionstring for the StoreSalesDAL "data source=TESTBOX1;initial catalog=CLOV7Sales;integrated security=SSPI;persist security info=False;packet size=4096"

This is the result of setting the actualconnectionstring for the StoreSalesACCESS "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\ggphoDATA\CLOV7Sales.MDB"

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 24-Jun-2010 05:41:19   

I understand that you have more than one servers and multple catalogs (same schema), but I don't understand what the problem is. Could you please elaborate a little bit more?

David Elizondo | LLBLGen Support Team
BISHMAN
User
Posts: 41
Joined: 30-Jan-2010
# Posted on: 24-Jun-2010 14:51:31   

I have one server named "TextBox1", on that server I have multple databases. For example, I have "CLOV7Sales", "HORSSales", "GGP30Sales", and "StoreSales" that all have the same schema. As I stated before I used the "StoreSales" database to create the LLBLGen code. What I am trying to do is to write the data from an ACCESS database to one of the databases on the server.

For example, with the code in the original post I am trying to take the data from an ACCESS database with a path of "C:\ggphoDATA\CLOV7Sales.MDB" and writting it to the "CLOV7Sales" database located on the "TextBox1" server.

When I run the code it writes the data from the ACCESS database with a path of "C:\ggphoDATA\CLOV7Sales.MDB to the "StoreSales" database on the "TestBox1" server instead of the "CLOV7Sales" database.

I hope this helps explain what I am trying to do.

Thanks

BISHMAN
User
Posts: 41
Joined: 30-Jan-2010
# Posted on: 24-Jun-2010 14:52:27   

Sorry, the server name is TestBox1.

BISHMAN
User
Posts: 41
Joined: 30-Jan-2010
# Posted on: 24-Jun-2010 16:07:02   

Thanks for your time but I found what I was missing. I had to add the following to the config file. <add key="StoreSales" value="" />