PBOSL - A OpenSource Library-Collection for PureBasic

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
Konne
Enthusiast
Enthusiast
Posts: 434
Joined: Thu May 12, 2005 9:15 pm

Post 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.
Apart from that Mrs Lincoln, how was the show?
X
Enthusiast
Enthusiast
Posts: 311
Joined: Tue Apr 04, 2006 6:27 am

Post by X »

DBin does not work without "CipherExtension", and that module is not in PBOSL. Does anybody know where to get that?
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

Just delete the dbin lib from your library folder and use the actual source code. :)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Armoured
Enthusiast
Enthusiast
Posts: 346
Joined: Mon Jan 26, 2004 11:39 am
Location: ITALY
Contact:

Post by Armoured »

Pbosl is compatible with PureBasic 4.20?
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

DarkDragon wrote:PBOSL update:
- compiled for 4.20 - updated the make batch files
- ExDatabase added.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
byo
Enthusiast
Enthusiast
Posts: 635
Joined: Mon Apr 02, 2007 1:43 am
Location: Brazil

Post 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
.
Proud registered Purebasic user.
Because programming should be fun.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post 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
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
byo
Enthusiast
Enthusiast
Posts: 635
Joined: Mon Apr 02, 2007 1:43 am
Location: Brazil

Post 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).
Proud registered Purebasic user.
Because programming should be fun.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post 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"
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
byo
Enthusiast
Enthusiast
Posts: 635
Joined: Mon Apr 02, 2007 1:43 am
Location: Brazil

Post 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.
Proud registered Purebasic user.
Because programming should be fun.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post 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.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post 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().
DarkDragon
Addict
Addict
Posts: 2218
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Post 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.
bye,
Daniel
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post 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.
User avatar
Tomi
Enthusiast
Enthusiast
Posts: 270
Joined: Wed Sep 03, 2008 9:29 am

Post by Tomi »

is there a version compatible with PB 4.0?
Post Reply