List Info

Thread: Re: Deployment of Project




Re: Deployment of Project
country flaguser name
United States
2007-10-16 20:28:14

I am answering Bob' questions re: my problem. (1) I have checked the ADO dc
control properties,
(2) I am connected thru the "connesction string" which definitely specifies
the correct path and
filename, (3) I used the wizard to create the connection string, (4) I am
using a string to specify
the recordsource ('SELECT * From Apmst Order by Vendor"), (5) I have used
the "find" feature
multiple times. I'll appreciate any additional help or comments.

DRG

>From: "Bob&quot; < usewillow%40verizon.net">usewillowverizon.net>
&gt;Reply-To: helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com
&gt;To: < helpwithvb%40yahoogroups.com">helpwithvbyahoogroups.com>
>Subject: Re: [helpwithvb] Deployment of Project
>Date: Mon, 15 Oct 2007 23:14:01 -0700
&gt;
>In addition to checking the code for the data control have you looked at
>the properties of the control? Perhaps that has a stray reference to the
>Accounting master. Which data control are you using (ADO ... DAO)? How did
>you connect to the Db? Did you use the wizard or write the code? Are you
>using any SQL statements? These are a few additional places to look. You
>might also try using the "find" section of VB6 to search your code.
&gt;Bob
>; ----- Original Message -----
&gt; From: Donald Gaither
> To: helpwithVB%40yahoogroups.com">helpwithVByahoogroups.com
&gt; Sent: Monday, October 15, 2007 3:30 PM
> Subject: [helpwithvb] Deployment of Project
>
>
> I have two VB6 programs on my C: drive ("Accounting Master&quot;
> and "Budget Master&quot;). I am near completion for the Budget
&gt; Master and am trying to create the necessary files through the
> Package and Deployment feature. When I compile and load
>; the program to another machine, I get this message:
>
>; "C:Accounting MasterGeneral Ledger.mdb is not a valid path"
>
&gt; Of course, there is no AccountingMaster directory on the second
&gt; machine. I have numerous orms in the project, all of which I
> have checked meticulously (multiple times( to be certain that each
>; Data Control specifies the Budger Master General Ledger.mdb. I
> have not discovered any reference in this project to "Accounting
&gt; Master&quot;. I have searched all attributes of the Budget Master data
>; file (General Ledger) for a reference to Accounting Master, but
> found none. Any ideas about where I might look?
&gt;
> DRG
>
>
&gt;
>

__._,_.___
.

__,_._,___
Re: Deployment of Project
country flaguser name
United States
2007-10-18 20:51:27

Have you tried to set the connection string to find the db ? Here is what MS has; in addition to the below items MS recommends that if you are using an Access db then you should use DAO connection with the Jet 4.0

Connecting to a Data Source

ADO provides the Connection object for establishing and managing connections between your applications and OLE DB compliant data sources or ODBC compliant databases. The Connection object features properties and methods you can use to open and close database connections, and to issue queries for updating information.

To establish a database connection, you first create an instance of the Connection object. For example, the following script instantiates the Connection object and proceeds to open a connection:

<%

  'Create a connection object.
  Set cnn = Server.CreateObject("ADODB.Connection")
  'Open a connection using the OLE DB connection string.
  cnn.Open  "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:MarketDataProjectedSales.mdb"
%>

Note &nbsp; The connection string does not contain spaces before or after the equal sign (=).

In this case, the Connection object's Open method refers to the connection string.

Be sure to check your connection string against these examples.

Creating a Connection String

The first step in creating a Web data application is to provide a way for ADO to locate and identify your data source. This is accomplished by means of a connection string, a series of semicolon delimited arguments that define parameters such as the data source provider and the location of the data source. ADO uses the connection string to identify the OLE DB provider and to direct the provider to the data source. The provider is a component that represents the data source and exposes information to your application in the form of rowsets.

The following table lists OLE DB connection strings for several common data sources:

Data Source OLE DB Connection String
Microsoft® Access Provider=Microsoft.Jet.OLEDB.4.0;Data Source=physical path to .mdb file
Microsoft SQL Server Provider=SQLOLEDB.1;Data Source=path to database on server
Oracle Provider=MSDAORA.1;Data Source=path to database on server
Microsoft Indexing Service Provider=MSIDXS.1;Data Source=path to file

To provide for backward compatibility, the OLE DB Provider for ODBC supports ODBC connection string syntax. The following table lists commonly used ODBC connection strings:

Data Source Driver ODBC Connection String
Microsoft Access Driver={Microsoft Access Driver (*.mdb)};DBQ=physical path to .mdb file
SQL Server DRIVER={SQL Server};SERVER=path to server
Oracle DRIVER={Microsoft ODBC for Oracle};SERVER=path to server
Microsoft Excel Driver={Microsoft Excel Driver (*.xls)};DBQ=physical path to .xls file; DriverID=278
Microsoft Excel 97 Driver={Microsoft Excel Driver (*.xls)};DBQ=physical path to .xls file;DriverID=790
Paradox Driver={Microsoft Paradox Driver (*.db)};DBQ=physical path to .db file;DriverID=26
Text Driver={Microsoft Text Driver (*.txt;*.csv)};DefaultDir=physical path to .txt file
Microsoft Visual FoxPro® (with a database container) Driver={Microsoft Visual FoxPro Driver};SourceType=DBC;SourceDb=physical path to .dbc file
Microsoft Visual FoxPro (without a database container) Driver={Microsoft Visual FoxPro Driver};SourceType=DBF;SourceDb=physical path to .dbf file

Further info ...

Opening a Separate ADO Connection

At some point, you may have to open and manage your own ADO connection to a Jet database. For example, you would have to use this approach if you are writing your code in a database that is separate from the database that contains the data that you need to access. Note that when you use this approach, Microsoft recommends that you close the ADO connection that you opened when it is no longer needed. For example, you may want to close the ADO connection in the UnLoad event of the form.

The following example demonstrates how to open your own ADO connection to a Microsoft Jet database and to bind a form to it:
1. Create a new blank database.
2. Import the Customers form from the sample database Northwind.mdb.
3. Open the Customers form in Design view.
4. Clear the RecordSource property of the form to unbind form.
5. Set the OnOpen property of the form to the following event procedure:
Private Sub Form_Open(Cancel As Integer)
   Dim cn As ADODB.Connection
   Dim rs As ADODB.Recordset
         
   'Create a new ADO Connection object
   Set cn = New ADODB.Connection

   With cn
      .Provider = "Microsoft.Access.OLEDB.10.0"

      .Properties("Data Provider").Value = "Microsoft.Jet.OLEDB.4.0"
      .Properties("Data Source").Value = _
          "C:Program FilesMicrosoft OfficeOffice10" & _
          "SamplesNorthwind.mdb"
      .Open
   End With

   'Create an instance of the ADO Recordset class, and
   'set its properties
   Set rs = New ADODB.Recordset
   With rs
      Set .ActiveConnection = cn
      .Source = "SELECT * FROM Customers"
      .LockType = adLockOptimistic
      .CursorType = adOpenKeyset
      .Open 
   End With
   
   'Set the form's Recordset property to the ADO recordset

   Set Me.Recordset = rs
   Set rs = Nothing
   Set cn = Nothing
End Sub
					
6. Add the following code to the UnLoad event of the form:
Private Sub Form_Unload(Cancel As Integer)
   'Close the ADO connection we opened
   Dim cn As ADODB.Connection
   Set cn = Me.Recordset.ActiveConnection
   cn.Close
   Set cn = Nothing
End Sub
					
7. Save the form, and then close it.
8. Open the Customers form in Form view.
9. Add, edit, or delete a record in the form.
Note that the form is bound to an updateable recordset that is using Jet data.


 
----- Original Message -----
Sent: Tuesday, October 16, 2007 6:28 PM
Subject: Re: [helpwithvb] Deployment of Project

.

__._,_.___
.

__,_._,___
Re: Deployment of Project
country flaguser name
United States
2007-10-19 20:30:35

Hi Donald...Lets take a look at the code. first create a new duplicate of the project that has the connection problem. Then test this duplicate to make sure it is having the same problem. If it does not then all is well. BUT if it still has the same error then go and make a modification to the ADO connection. Here is a string that works for me using my simple db programs. Hope it helps
 
Establish Connection with The database
Private Function bgetConnected()As Boolean
On Error goto ConnErr
GetConnectedb=False
&nbsp;   ; &nbsp;  Set objConn = New ADODB.Connection
&nbsp; &nbsp; &nbsp; &nbsp; StrConnStr= "Provider=Microsoft.Jet.OLEDB.4.0;" & _
   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp;  "Data Source=” App.path & “mydeb.mdb"
 &nbsp;   ; &nbsp; Objconn.Open StrConnStr
 &nbsp; &nbsp;   ; bGetConnected=true
Exit Function
ConnErr:
Msgbox “Unable to Connect to the Database becaue” & Err.Description, VbInformation
End Function

__._,_.___
.

__,_._,___
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )