Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

OpenDatabase Error (-7748) with Sybase

Posted on 2003-12-03
5
Medium Priority
?
708 Views
Last Modified: 2013-12-25
Hi experts heres a tricky one!

I'm trying to connect to a Sybase Databse and an Access database, the idea is to pass information from access to Sybase. I'm using DAO Database and Recordsets in both cases, but when trying to run a select statement to gather the information I need to validate I get the -7748 reserved error with the legend "There is no message for this Error".

I'm defining my variables inside a module like this:

Global wrkJet As Workspace
Global MyDB As Database
Global MyDBSyb As Database
Global rs As DAO.Recordset
Global rs2 As DAO.Recordset
Global rssyb As DAO.Recordset


And the code in my form goes like this:

Private Sub Form_Load()
    Set wrkJet = CreateWorkspace("", "admin", "")
    Set MyDB = wrkJet.OpenDatabase("codigos.mdb")
    Set MyDBSyb = wrkJet.OpenDatabase("Telephony", _
    dbDriverNoPrompt, False, _
    "ODBC;DATABASE=telephony;UID=uid;PWD=pwd;DSN=telephony")
End Sub

Private Sub Command2_Click()
    strsql = "SELECT usuario.idext, usuario.usu_noext, usuario.usu_nom, usuario.usu_pwd," _
    & " usuario.usu_cod1, usuario.usu_cod2" _
    & " FROM usuario ORDER BY usuario.usu_noext"
    Set rssyb = MyDBSyb.OpenRecordset(strsql)


   more code here .....


I have used some similar code for connecting to sybase with no problem, actualy I already check the database and do some querys using other tools (Microsoft Query) to check if there was a problem with the Db or ODBC, but sadly with no luck.

Thanks in advance!!

0
Comment
Question by:ecantu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 29

Accepted Solution

by:
leonstryker earned 2000 total points
ID: 9871103
I would go with ADO


Public MyDB As ADODB.Connection
Public MyDBSyb As ADODB.Connection
Public rs As ADODB.Recordset
Public rs2 As ADODB.Recordset
Public rssyb As ADODB.Recordset


And the code in my form goes like this:

Private Sub Form_Load()

    Set MyDB = New ADODB.Connection
    Set MyDBSyb = New ADODB.Connection

    MyDB.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
           "Data Source=c:\somepath\myDb.mdb;" & _
           "User Id=admin;" & _
           "Password="

    MyDBSyb.Open "Provider=Sybase.ASEOLEDBProvider;" & _
           "Srvr=myASEServer,5000;" & _
           "Catalog=myDBName;" & _
           "User Id=myUserName;" & _
           "Password=myUserPassword"

End Sub

Private Sub Command2_Click()
    strsql = "SELECT usuario.idext, usuario.usu_noext, usuario.usu_nom, usuario.usu_pwd," _
    & " usuario.usu_cod1, usuario.usu_cod2" _
    & " FROM usuario ORDER BY usuario.usu_noext"
 
    Set rssyb = New ADODB.Recordset
    rssyb.Open strsql, MyDBSyb, adOpenStatic, adLockOptemistic

Leon
0
 
LVL 27

Expert Comment

by:Dabas
ID: 9873796
Hi ecantu:
Which line does the error occur on?

Dabas
0
 

Author Comment

by:ecantu
ID: 9875128
The last line in the Command2_Click() event:

Set rssyb = MyDBSyb.OpenRecordset(strsql)
0
 

Author Comment

by:ecantu
ID: 9875679
I change the code to ADO where I used the Sybase Db and keep using DAO for Access and worked fine (for my puorpuose anyway :p)


Thanks leonstryker!
0
 
LVL 29

Expert Comment

by:leonstryker
ID: 9875704
You are right to keep it that way.  DAO works great with Access, but it was never meant to be used with anything else.

Thanks for the grade,

Leon
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question