Solved

VB and Sybase

Posted on 2001-06-17
3
222 Views
Last Modified: 2012-06-21
Folks, I know the points are low but that is all I have and I need help.

I have sybase 11.03 and Visual basic 6. I want to write a program in VB that connects to the Sybase database using ODBC. When I tried to set an ODBC data source there is ODBC driver for the Sybase listed. How can I identify the ODBC driver for Sybase 11 to set the data souce.
Can I directly connect the database without using ODBC data source.
I have little knowldege of Sybase I read the following statement from the net but I don't know what it means.

"Configure Sybase on your PC. Make sure you have an entry in your SYBASE.INI file for your sybase server. "

Thank you
0
Comment
Question by:yassin092898
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
amitpagarwal earned 85 total points
ID: 6200878
Listening .. see if the code below offers some help...

u need to set up a data source by adding a Sybase System 11 driver.

Thanks,
Amit Agarwal.

   Dim db As Database
   Dim wksp As Workspace

   connstr = "ODBC;DATABASE=" & dbname & ";UID=" & Text2.Text & ";PWD=" & Text3.Text & ";DSN=gsdb"
   Set wksp = CreateWorkspace("ODBCWorkspace", "", "", dbUseODBC)
   Set db = wksp.OpenDatabase("gsdb", dbNoDriverPrompt, , connstr)

   Dim rec As Recordset
   Set rec = db.OpenRecordset("select name from sysobjects where type='U' or type='V' order by name")

   While Not rec.EOF
       Box1.AddItem (rec.Fields(0).Value)
       rec.MoveNext
   Wend
   
   rec.Close
   db.Close
   wksp.Close
0
 

Author Comment

by:yassin092898
ID: 6202109
How can I set the Sybase driver when none is listed in the ODBC listing. What is the Sybase 11 driver dll name and how Can I install it to appear in the ODBC driver listing.

Thank you.
0
 
LVL 5

Expert Comment

by:amitpagarwal
ID: 6202451
I guess you can download the ODBC driver from www.sybase.com website or www.merant.com (formerly, INTERSOLV)

Thanks.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Read about the ways of improving workplace communication.
For months I had no idea how to 'discover' the IP address of the other end of a link (without asking someone who knows), and it drove me batty. Think about it. You can't use Cisco Discovery Protocol (CDP) because it's not implemented on the ASAs.…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 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