Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC Connection String (ADO)? 1

Status
Not open for further replies.

CaptainN64

Programmer
Oct 23, 2002
9
US
I've got a SQLBase8.0 database which I can connect to successfully with the SQLBase DBA Utility and through Crystal Reports. However, I have had absolutely NO luck trying my own ODBC connections. Could someone post a successfully working connection string that I could play with? Thanks! =)

<aptain/\/64
 
Hello, I also am having a problem trying to connect to a SQLBASE 6.1.2 database using ODBC via a VB program and can not get it to work. I have used ODBC Test program and I am getting an error message saying I am missing configuration entry in my SQL.ini file.

Were you ever able to get it to work and if so how? I would appreciate any help you can give me.
 
No, I was never able to get a solution... My company decided to give up and to just re-type the data in by hand into an ACCESSABLE database.
 
1.) Make sure you've installed Centura's most recent OLEDB drivers (you'll find it in their downloads section)
2.) In VB reference SQLBASEOLEDB 1.0 Type Library (sqlbaseoledb.dll)
3.) Then code to it:
Dim objSQLBaseServer As SQLBASEOLEDBServer
Set objSQLBaseServer = New SQLBASEOLEDBServer
Dim strServer As String
Dim strPwd As String

strServer = &quot;SvrName&quot;
strPwd = &quot;sysadm&quot;
objSQLBaseServer.ConnectServer strServer, strPwd

objSQLBaseServer.DisconnectServer

Set objSQLBaseServer = Nothing
4.) If using ADO (Microsoft ActiveX Data Objects) 2.7 for example, again reference it (msado15.dll) in VB.
5.) Then code to it:
Dim rs As ADODB.Recordset
Dim cn As ADODB.Connection
Dim cm As ADODB.Command
Dim strConn As String
strConnGupta = &quot;Provider=SQLBaseOLEDB; Data Source = MyOdbcDSNname&quot;
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn.Open strConnGupta
rs.Open Text1.Text, cn, adOpenKeyset, adLockBatchOptimistic, adCmdText

Hope it helps...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top