Page 14 of 16

Posted: Sun Jul 22, 2007 11:53 pm
by Konne
ts-soft wrote:
Konne wrote:Ain't there. There are only the dirs "ASM" and "C". Maybe someone can post it please.
In the directory, you found the ASM and C subdirectory, there is PBOSL.h
Figured it out. It is only in the 3.94 not in the 4.0 Package.

Posted: Mon Dec 03, 2007 3:29 am
by X
DBin does not work without "CipherExtension", and that module is not in PBOSL. Does anybody know where to get that?

Posted: Mon Dec 03, 2007 6:28 am
by DoubleDutch
Just delete the dbin lib from your library folder and use the actual source code. :)

Posted: Wed Jun 04, 2008 3:28 am
by Armoured
Pbosl is compatible with PureBasic 4.20?

Posted: Sun Jun 22, 2008 3:18 pm
by ts-soft
DarkDragon wrote:PBOSL update:
- compiled for 4.20 - updated the make batch files
- ExDatabase added.

Posted: Sun Jun 22, 2008 8:34 pm
by byo
Hi, thanks for the update.

Can you please explain how the AddDSN and AddSystemDSN procedures work? I'm not sure how to specify a DSN entry name or if there are constants for the Driver.s parameter.

Sugestion: make only one command

Code: Select all

AddDSN(dsn.s, database.s, user.s password.s, driver.s, attributes.s, dsnType.l)
where dsnType would be something like:

Code: Select all

#ExDatabase_DSN_User
#ExDatabase_DSN_System
.

Posted: Sun Jun 22, 2008 8:43 pm
by ts-soft
In the PBOSL_Examples Pack a examples for:
firebird, mysql, sqlite3 and mdb
Here a mdb example:

Code: Select all

; Original by PAMKKKKK
; angepaßt für PBOSL_ExDatabase und PB4 by ts-soft und mk-soft

EnableExplicit

UseODBCDatabase()
;InitDatabase()

Define.s dbName = "d:\exDatabase_test.mdb" ; könnt Ihr anpassen
Define.s DSN
Define.s SQL
Define.l db = 0
Define.l result

If CreateEmptyMDB(dbName) ; leere Datenbank erstellen
  DSN = AddDSN(dbName, "", "") ; DSN hinzufügen
EndIf
Debug "DSN=" + dsn
; Datenbank verbinden
If OpenDatabase(db, DSN, "", "") = 0
  End
EndIf

If IsDatabase(db)
  Debug "Start..."
  ; SQL Befehl zum Tabelle erstellen
  SQL = "Create table Adress (id autoincrement, vorname text(50), nachname text(50), constraint Adress unique(id));"
  If DatabaseQuery(db, SQL) ; SQL Befehl ausführen
    ; SQL Befehl zum einfügen von Daten in die Tabelle
    SQL = "Insert into Adress (vorname, nachname) values ('Thomas', 'Schulz')"
    DatabaseQuery(db, SQL) ; SQL Befehl ausführen
    SQL = "Insert into Adress (vorname, nachname) values ('Max' ,'Mustermann')"
    DatabaseQuery(db, SQL) ; SQL Befehl ausführen
    SQL = "Insert into Adress (vorname, nachname) values ('Erika', 'Mustermann')"
    DatabaseQuery(db, SQL) ; SQL Befehl ausführen
  Else
    Debug DatabaseError()
  EndIf
  
  ; SQL Befehl zum Auslesen von Daten der Tabelle
  SQL = "Select * from Adress order by nachname asc;"
  If DatabaseQuery(db, SQL) ; SQL Befehl ausführen
    Debug "Daten in Tabelle 'Adress'" : Debug ""
    While NextDatabaseRow(db) ; gelesene Daten aus der Datenbank durchlaufen
      Debug Str(GetDatabaseLong(db, 0)) + ": " + GetDatabaseString(db, 1) + " " + GetDatabaseString(db, 2) ; gelesene Daten aus der Datenbank ausgeben
    Wend
  EndIf
  CloseDatabase(db)
EndIf

; Tabellen lesen
If ExamineTables(dsn)
  Debug "Tabellen in Database:"
  Debug ""
  While NextTable()
    Debug GetTableName() + " <-- " + GetTableType()
  Wend
  Debug "" : Debug ""
EndIf

result = RemoveDSN(dbName); DSN wieder entfernen
If Result = 0
  MessageRequester("SQLError", GetSQLInstallerError())
EndIf
Sorry, the comments a german

Posted: Sun Jun 22, 2008 9:40 pm
by byo
Thank you for the example. Works really great here. :wink:

Besides that sugestion I made in my previous post, I'd like to add another one: the ability to define the DSN entry name (if it doesn't exist already).

Posted: Sun Jun 22, 2008 10:08 pm
by ts-soft
don't understand
AddDSN creates a entryname for you.
This should unique to your database. Normally you remove this after using.
For defined DSN you can use "OpenDatabaseRequester"

Posted: Mon Jun 23, 2008 1:17 am
by byo
I mean, in ODBC Administrator under Windows XP's administrative tools, you identify a DSN with a name. Sometimes I need that instance name to be a specific name, for application compatibility (more than one application using the same DSN).

So in my include, I inform the DSN name I want:

Code: Select all

ProcedureDLL MSSQL_MakeConnection(dsn.s, dsnType.l, user.s, password.s, database.s, server.s, dbNumber.l)
This is a just an example but notice that the first parameter is the DSN name. From your example a DSN name is created automatically or am I missing something?

Thanks for all your help.

Posted: Mon Jun 23, 2008 1:35 am
by ts-soft
byo wrote:From your example a DSN name is created automatically?
Yes

Code: Select all

DSN.s = AddDSN("mydb.mdb", "", "")
Have you another DSN name, so the Lib is not required.

Posted: Wed Jun 25, 2008 12:10 am
by Xombie
Can I create a server with the NT Service library? I'm using the example from PAMKKKKK as a starting point but I'm not sure how to make it play nice with CreateNetworkServer().

Posted: Wed Jun 25, 2008 8:17 am
by DarkDragon
Xombie wrote:Can I create a server with the NT Service library? I'm using the example from PAMKKKKK as a starting point but I'm not sure how to make it play nice with CreateNetworkServer().
:? Service <> Server. A service is a system-process running in background.

Posted: Wed Jun 25, 2008 3:51 pm
by Xombie
Yes, I understand what the difference is. I guess I should be more clear in what I'm trying to do.

I'd like a service running under an administrator account. I'd like a separate program to send data/files to this service. The service then writes those files to a specific location with appropriate security settings. Mostly that other non-admins can only read and not modify the files.

I could probably accomplish this by having the service monitor a directory and pick up and handle files from that directory but that idea is not so appealing.

Posted: Wed Sep 10, 2008 4:34 pm
by Tomi
is there a version compatible with PB 4.0?