Solved

VB and Sybase

Posted on 2001-06-17
3
225 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

A company’s centralized system that manages user data, security, and distributed resources is often a focus of criminal attention. Active Directory (AD) is no exception. In truth, it’s even more likely to be targeted due to the number of companies …
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

679 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