ODBC Database Connectivity Issue
Posted: Wed May 14, 2008 8:27 pm
Hello,
I have some code with works on Windows and when ported to Linux (PB 4.10) is has an issue. It seems to initialize ODBC okay but can't seem to open the database. I have the DNS configured and tested with iodbctest on the linux platform. Here is the code. If anyone has any suggestions on debugging this, please let me know thanks.
If UseODBCDatabase() = 0
Debug("Can't initialize Database (ODBC v3 or better) environment")
End
; ODBC Init Success Continue
Else
If OpenDatabase(0, "database", "testuser", "password") = 0
Debug("Can't open database")
End
Else
DatabaseQuery(0, "select * from tbl_name")
While NextDatabaseRow(0)
Debug(GetDatabaseString(0, 0) + " " + GetDatabaseString(0, 1))
Wend
CloseDatabase(0)
EndIf
EndIf
I have some code with works on Windows and when ported to Linux (PB 4.10) is has an issue. It seems to initialize ODBC okay but can't seem to open the database. I have the DNS configured and tested with iodbctest on the linux platform. Here is the code. If anyone has any suggestions on debugging this, please let me know thanks.
If UseODBCDatabase() = 0
Debug("Can't initialize Database (ODBC v3 or better) environment")
End
; ODBC Init Success Continue
Else
If OpenDatabase(0, "database", "testuser", "password") = 0
Debug("Can't open database")
End
Else
DatabaseQuery(0, "select * from tbl_name")
While NextDatabaseRow(0)
Debug(GetDatabaseString(0, 0) + " " + GetDatabaseString(0, 1))
Wend
CloseDatabase(0)
EndIf
EndIf