VServer+ php 2.2 Win error:Database entry has been removed from the
'master',
but it is still opened because there are connected clients...
Damon Pillinger
daisychain at iinet.net.au
Thu Feb 23 04:50:00 CST 2006
Hi Guys
I am using this PHP script to reset/clear my database but keep getting
errors
<?
//include("ibs_globals.php");
define( "host", "192.168.0.1:15432" );
define( "username", "sa" );
define( "password", "sa" );
valentina_connect( host, username, password ) or
die ("error connecting!");
valentina_drop_db( 'IBSclients');
valentina_close( );
valentina_connect( host, username, password ) or
die ("error connecting!");
valentina_drop_db( 'rewwer');
valentina_close( );
valentina_connect( host, username, password ) or
die ("error connecting!");
valentina_create_db( 'rewwer' );
valentina_create_db( 'IBSClients' );
valentina_close( );
valentina_connect( host, username, password ) or
die ("error connecting!");
valentina_select_db( 'rewwer' ) or
die("error selecting database!");
valentina_query( "CREATE TABLE LoginInformation
(
iAccountNumber string(15),
iIPaddress string(20),
iPassword string(15),
iClientName string(30),
iTotal integer ,
iRedirect string(50),
iLastLogin TimeStamp
)"
) or
die( "error creating table LoginInformation!" );
echo "OK<br>";
valentina_select_db( 'IBSClients' ) or
die("error selecting database!");
valentina_query( "CREATE TABLE Information
(
AccountNumber string(15),
Password string(15),
IBSRate double,
Alias string(15),
DirectorSurname string(20),
DirectorFirstName string(15),
DirectorMiddleNames string(30),
DirectorPrefix string(10),
DirectorSuffix string(20),
CompanyName string(40),
OfficeAddress1 string(30),
OfficeAddress2 string(30),
OfficeState string(20),
OfficeSuburb string(20),
OfficePostcode string(10),
OfficeCountry string(20),
OfficePhone1 string(30),
OfficePhone2 string(30),
OfficePhone3 string(30),
OfficePhone4 string(30),
OfficePhone5 string(30),
OfficeFax1 string(30),
OfficeFax2 string(30),
OfficeFax3 string(30),
OfficeFax4 string(30),
OfficeFax5 string(30),
OfficeEmail1 string(40),
OfficeEmail2 string(40),
OfficeEmail3 string(40),
OfficeEmail4 string(40),
OfficeEmail5 string(40),
OfficeMobile1 string(20),
OfficeMobile2 string(20),
OfficeMobile3 string(20),
OfficeMobile4 string(20),
OfficeMobile5 string(20),
OfficeWeb1 string(40),
OfficeWeb2 string(40),
OfficeWeb3 string(40),
OfficeWeb4 string(40),
OfficeWeb5 string(40),
PostalAddressAddress1 string(30),
PostalAddressAddress2 string(30),
PostalAddressState string(20),
PostalAddressSuburb string(20),
PostalAddresostcode string(10),
PostalAddressCountry string(20),
EmailSenderName string(30),
EmailSenderPosition string(30),
EmailSenderAddress1 string(30),
EmailSenderAddress2 string(30),
EmailSenderState string(20),
EmailSenderSuburb string(20),
EmailSenderPostcode string(10),
EmailSenderCountry string(30),
EmailSenderPhone string(20),
EmailSenderFax string(20),
EmailSenderMobile string(20),
EmailSenderEmail string(40),
EmailSenderWeb string(40),
AccountsSenderName string(30),
AccountsSenderPosition string(30),
AccountsSenderAddress1 string(30),
AccountsSenderAddress2 string(30),
AccountsSenderState string(20),
AccountsSenderSuburb string(20),
AccountsSenderPostcode string(10),
AccountsSenderCountry string(30),
AccountsSenderPhone string(20),
AccountsSenderFax string(20),
AccountsSendermobile string(20),
AccountsSenderEmail string(40),
AccountsSenderWeb string(40),
LetterSenderName string(30),
LetterSenderPosition string(30),
LetterSenderAddress1 string(30),
LetterSenderAddress2 string(30),
LetterSenderState string(20),
LetterSenderSuburb string(20),
LetterSenderPostcode string(10),
LetterSenderCountry string(30),
LetterSenderPhone string(20),
LetterSenderFax string(20),
LetterSendermobile string(20),
LetterSenderEmail string(30),
LetterSenderWeb string(30),
UserMessage string(3000),
CurrentBilling double,
LastBilling double,
Last2Billing double,
ClientCount double
);" ) or
die( "error creating table Client Information!" );
valentina_close( );
die ("quit early");
?>
the first time it runs it obviously pulls errors at the "drop table"
points but will create the database and fill the information.
The next time it is run it pulls this error in the Vserver log
15:35:01.060000 (2236): Connection established with
'daisycha-server.mshome.net:4926' (488)
15:35:01.076000 (3832): (488) Database: <none>; User: sa: OK
15:35:01.123000 (2236): (488) Unregistering database 'ibsclients': OK
15:35:01.123000 (2236): Closing connection (488)
15:35:01.123000 (740): Connection established with
'daisycha-server.mshome.net:4927' (556)
15:35:01.139000 (2800): (556) Database: <none>; User: sa: OK
15:35:01.185000 (740): (556) WARNING: Unregistering database 'rewwer':
OK (Database entry has been removed from the 'master', but it is still
opened because there are connected clients...)
15:35:01.185000 (2800): Closing connection (556)
Obviously I am not closing the Vserver connection/database correctly,
what else do I have to do other then valentina_close( ); to disconnect ?
Best regards
Damon L. Pillinger
Director Daisychain EDi
Suite 3
4 Winston Court
Moorabbin 3189
Phone : +61 3 9532 1220
Fax : +61 3 9532 1280
-----Original Message-----
From: valentina-bounces at lists.macserve.net
[mailto:valentina-bounces at lists.macserve.net] On Behalf Of Damon
Pillinger
Sent: Wednesday, 22 February 2006 1:24 PM
To: 'Valentina Developers'
Subject: VServer list of Databases
Hi Guys,
Am using this to get a list of databases on the server, it has worked
fine for the past hour but it now stops
vs=new VServer("192.168.0.1","sa","sa")
if vs<>nil then
vs.OpenSession()
listbox1.deleteAllRows
i1=vs.DatabaseCount
MsgBox str(i1)
for i = 1 to i1
dbi=new VDataBaseInfo
dbi = vs.DatabaseInfo( i )
ListBox1.AddRow dbi.Name
next
end if
There are 3 databases according to the i1 variable.
The first database "master" loads the information fine, but when it hits
dbi = vs.DatabaseInfo( i ) where i=2 it just locks up.
Any ideas, I have restarted the server, disabled/enabled the network
connections, deleted the databases and recreated etc...
I don't know if this counts but I had progressed all the way to running
SQL queries on the database/table and it returned weird characters i.e.
should have been 111 but returned 1 surrounded by unknown characters.
Thanks
Best regards
Damon L. Pillinger
Director Daisychain EDi
Suite 3
4 Winston Court
Moorabbin 3189
Phone : +61 3 9532 1220
Fax : +61 3 9532 1280
_______________________________________________
Valentina mailing list
Valentina at lists.macserve.net
http://lists.macserve.net/mailman/listinfo/valentina
More information about the Valentina
mailing list