Welcome! Log In Create A New Profile

Advanced

Deployment with External Database

Posted by Andre Theron.pcs.crosspost 
Andre Theron.pcs.crosspost
Deployment with External Database
October 07, 2008 03:40PM
Hi,

My problem is that when I deploy my windev app, I wish to specify the Connection Details for my database.

I have made a small test program using SQLEXPRESS as my data base. I specified 1 file in the analysis and created only 1 window with a table component on it.

When testing my program from within windev it works fine. When creating my setup I specify that I wish to change the details for the server for my database.

In the Hyper File C/S part of the Setup Editor I specify MyConnection1 with default values ( the ones I used to test my program with ).

Firstly there is an extra connection (Automatic Connection) used for replication. I do not use that in my application but it seems there is no way to remove this connection. When I do not specify any parameters for this Automatic Connection, the setup fails with a message : Automatic Connection cannot be changed and no values specified. So I ended up specifying the same values for Automatic Connection that I used for MyConnection1.

When running the setup it now continues and installs my application. When running my application after this installation it fails with error :






==================================================================================
Unable to initialize 'TABLE_DATA_PRICE_FILE_SETUP' control. Hyper File Error:
=============================
OLE DB access error.
Error Number = 170124

Failure opening connection:
Data Source: <CTDEVNL09\SQLEXPRESS:4900>
OLEDB Provider: <SQLOLEDB>
=============================

System Error Details:

Description = [DBNETLIB][ConnectionOpen (ParseConnectParams()).]Invalid connection.
Source = Microsoft OLE DB Provider for SQL Server
SQL State = 08001
Error Number = -2147467259
Native Error Number = 14


Technical Information

Project : DBTEST3

Dump error of module <WD120OBJ.DLL> <12.00Pxe>.

- Level: fatal error (EL_FATAL)

- Error Code: 10085

- WD55 Error Code: 3001

- No system error code

- System Error Message:
Description = [DBNETLIB][ConnectionOpen (ParseConnectParams()).]Invalid connection.
Source = Microsoft OLE DB Provider for SQL Server
SQL State = 08001
Error Number = -2147467259
Native Error Number = 14


- What happened?
Unable to initialize 'TABLE_DATA_PRICE_FILE_SETUP' control. Hyper File Error:
=============================
OLE DB access error.
Error Number = 170124

Failure opening connection:
Data Source: <CTDEVNL09\SQLEXPRESS:4900>
OLEDB Provider: <SQLOLEDB>
=============================

- Debug Information:
IEWDOLDB=105003
Module=<WDOLDB>
Version=<12.00Bg>

MDAC Version = <6.0.6001.18000>.



[Connection parameters]
DataSource = <CTDEVNL09\SQLEXPRESS:4900>
Initial Catalog = <>
Provider = <SQLOLEDB>
User = <sa>
Password = <,###>
Extended Info = <Initial Catalog=PeresysMDS;;Initial Catalog=peresysmds;Initial Catalog=peresysmds;Initial Catalog=peresysmds;Initial Catalog=peresysmds;Initial Catalog=peresysmds;Initial Catalog=peresysmds;Initial Catalog=peresysmds;Initial Catalog=peresysmds;Initial Catalog=peresysmds;Initial Catalog=peresysmds;Initial Catalog=peresysmds;Initial Catalog=peresysmds;Initial Catalog=peresysmds;Initial Catalog=peresysmds;Initial Catalog=peresysmds;Initial Catalog=peresysmds>
Access = <Read/Write>

[Connection settings]
ConnectionTimeout = <-1>
CommandTimeout = <-1>

[Data format]
Query Parameter Checked = <0> = <>
Query Parameter Needing conversion = <64> = <DECIMAL>
DecimalSeparator = <Undefined>
DateFormat = <>

[Cursor settings Match]
LockType = <adLockUnspecified>, Location = <adUseNone>, Type = <adOpenUnspecified>, Capacities = <ffffffff>
LockType = <adLockUnspecified>, Location = <adUseNone>, Type = <adOpenUnspecified>, Capacities = <ffffffff>
LockType = <adLockUnspecified>, Location = <adUseNone>, Type = <adOpenUnspecified>, Capacities = <ffffffff>


- Attached Information:
EIT_ADOCODE : <-2147467259>
EIT_BASECODE : <14>
EIT_ODBCDESCRIPTION : <[DBNETLIB][ConnectionOpen (ParseConnectParams()).]Invalid connection.>
EIT_ODBCCODE : <08001>
EIT_NATIVECODE : <170124>
EIT_LOGICALTABLENAME : <DATA_PRICE_FILE_SETUP>

- Identifier in .err: 10085


Help

- Consult Hyper File help for this error.
- Use HOpen() to check Hyper File correctness.
- When using a query, check whether it is properly initialized.
- Initialization must not occur in the table code but in the "global declarations" code of
the current window.
==================================================================================






Even changing the port number to 1433 which is used by SQLEXPRESS in the MyTest.wx file does not solve the problem.

Can anyone please shed some light on why this can be happening and how to solve it.

Thanks
Andre.

Message forwarded from pcsoft.us.windev
pat.pcs.crosspost
Re: Deployment with External Database
October 07, 2008 05:26PM
Hi,

Your production server is not the same as your test server. There is no way your site will work. You have to change the connection code. The Setup will not help you in this case. It only works for HF C/S. You may use an external text file, or any other way, to specify the connection informations to your program.

--
pat
[ilikewd.free.fr]

Message forwarded from pcsoft.us.windev
Andre Theron.pcs.crosspost
Re: Deployment with External Database
October 07, 2008 06:28PM
Thanks for the fast response Pat,

I have one problem though, although I am fairly sure it should be easy to solve. For all the tables that I use in my application I have specified the Browsing Table property with a direct link to my database ( instead of using memory tables or queries ). This allows me to rapidly design new screens with almost no code at all. I am using an analysis with files in them that point to my SQL Server database. So I am not using hyperfiles at all.

Is it possible to have a text file ( ini file ) that I can just read in at my application startup and specify the Connection properties of my analysis ?
And if possible can you maybe give a small explanation of how to get this done.

Thanks.
Andre.

Message forwarded from pcsoft.us.windev
Paulo Oliveira
Re: Deployment with External Database
October 07, 2008 07:38PM
Yes you can.
For instance put all the connection information (db server, db name, user, password,etc.) in one ini file, use IniRead to get the values and them use HDescribeConnection, HOpenConnection, HChangeConnection.
when you deploy your windev app just make a small project to fill all the information in the ini file and thats all.

something like this:

G_USERDB is string =INIRead("DB", "USERDB", "", fExeDir() + "\db.ini"))
G_PASSWORDDB is string=INIRead("DB", "PASSWORDDB", "", fExeDir() + "\db.ini"))
G_DBSERVER is string=INIRead("DB", "DBSERVER", "", fExeDir() + "\db.ini"))
G_NAMEDB is string=INIRead("DB", "NAMEDB", "", fExeDir() + "\db.ini"))

HDescribeConnection("BD_CONN",G_USERDB ,G_PASSWORDDB ,G_DBSERVER ,G_NAMEDB ,hNativeAccessMySQL,hOReadWrite,"WD Connection Timeout = 300; WD Command Timeout=300")

HOpenConnection("BD_CONN")

HChangeConnection("*","BD_CONN")
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: