![]() |
Large PDB Database Classes for PocketPC/Symbian | |
| Links Contact Us FAQ Samples Purchase Classes Revision Log: 02/15/05 - Include class that mimics many functions found in the afPDBLib 02/14/05 - Fixed Bug in UniCode to handle more all UniCode Blocks. 02/14/05 - Fixed Bug in ReadNextModified that ignored first record in the database
|
These Classes will allow you Read-Only access to PDB database records without the performance hit on Open and Closing of your application. This is not a replacement for the Appforge PDB libraries if you need to write records, but will allow you to access large PDB databases without Open and Close performance hit that Memory-Mapped files created. Here is an example: Dim oPDB As New PDBDatabase
Dim oByteStream As New PDBByteStream
Dim oAppForgeHeader As New PDBAppforgeDefinition
Dim oAppForgeData As New PDBAppforgeRecord
' Changes information in a database
oPDB.PDBDatabaseName = "AFSampleTable"
If oPDB.OpenDatabase Then
' Gets the Appforge file infor
Set oAppForgeHeader = New PDBAppforgeDefinition
' Read the PDB AppInfo Block to get Appforge Header information
oPDB.ReadAppInfoBlock oByteStream
If oAppForgeHeader.IsAppforgeData(oByteStream) Then
' This is an appforge database. Setup the Appforge header
' information
Set oAppForgeData.AppforgeDefinition = oAppForgeHeader
' Create the Appforge Record Class
Set oByteStream = New PDBByteStream
If oPDB.ReadNextByIndex(1, 0, 0, 0, oByteStream) Then
' Successful
Else
' Failed
End If
Set oAppForgeData.ByteStream = oByteStream
Debug.Print oAppForgeData.BooleanValue(1) & " = True"
Debug.Print oAppForgeData.ByteValue(2) & " = 10"
Debug.Print oAppForgeData.CurrencyValue(3) & " = 55"
Debug.Print oAppForgeData.DateValue(4) & " = 1/31/2002"
Debug.Print oAppForgeData.SingleValue(5) & " = 1.3"
Debug.Print oAppForgeData.DoubleValue(6) & " = .5544332211"
Debug.Print oAppForgeData.IntegerValue(7) & " = 340"
Debug.Print oAppForgeData.LongValue(8) & " = 45300"
Debug.Print oAppForgeData.StringValue(9) & " = Hello"
Else
' Not Appforge
MsgBox "Not an Appforge Database"
End If
' Close
oPDB.CloseDatabase
Else
MsgBox "Failed to open " & oPDB.PDBDatabaseName
End If
The zip file you receive will include a sample form and all class with source code for creating PDB databases. |
|