I have a small test program that works fine in Windows, but after dragging its JAR file and installing Java on PC-BSD (a flavor of FreeBSD) it fails:
java.lang.NullPointerException
at VB.Database.ExecuteStatement(DataBase.jsrc)
at Form1.Form_Load(Form1.jsrc:16)
at ...
I've also noticed that both App.Path and CurDir$() return values that are "off a bit" on this platform, but for all I know it has something to do with the way the filesystem there handles vitual folders like Desktop. I'm putting the JAR file and the MDB file into a folder on the PC-BSD Desktop.
Hard-coding paths did not help get rid of the exception though.
I'm also not really expecting to be able to open a Jet MDB over there, however I note that ConnectMDB does not seem to be using the native Jet Engine even on Windows, so I thought I'd give it a shot.
Code fragment:
|
Jabaco Source
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
Option Explicit
Import java#sql
Private RS As ResultSet
Private Meta As ResultSetMetaData
Public Sub Form_Load()
Dim Col As Integer
Dim DateVal As Date
Dim StrVal As String
Dim DateFmtr As New SimpleDateFormat("yyyy-MM-dd")
MsgBox CurDir$() & "/test.mdb"
Database1.ConnectMDB CurDir$() & "/test.mdb"
Set RS = Database1.ExecuteStatement("SELECT * FROM Employees")
Set Meta = RS.getMetaData()
With JBGrid1
|
Suggestions?