Results 1 to 13 of 13
  1. #1
    Lounger
    Join Date
    Sep 2001
    Location
    Philadelphia suburbs
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Connecting to Sybase (Visual Basic 6.0)

    Hi all,

    I'm a newbie to VB.
    I've been told that in order to connect to a Sybase database with VB 6.0, I
    need the Developer's edition so that I can use ADO. Yet I've also heard
    that I can make this connection with the Professional edition. Could anyone
    tell me the best way to make this connection, and if I do need Developer. I want to allow the users to view and modify a Sybase table

    Thanks very much,

    Sue

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Connecting to Sybase (Visual Basic 6.0)

    VB6 Professional *is* the developer's edition, unless you're referring to Visual Studio, which includes VB6 Pro plus other development tools like Visual FoxPro and Visual C++. ADO is included with all the versions, but you can't distribute applications using the Packaging Wizard unless you have the Professional version.
    Charlotte

  3. #3
    Lounger
    Join Date
    Sep 2001
    Location
    Philadelphia suburbs
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Connecting to Sybase (Visual Basic 6.0)

    Charlotte,

    Thanks for responding. Actually I am referring to Visual Studio. When you say that VB 6 is the developer's edition "unless you're referring to Visual Studio", do you mean that the Visual Studio VB Pro is different from 'non-Visual Studio' VB Pro?

    Sue

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Connecting to Sybase (Visual Basic 6.0)

    VB Pro is the "developer's edition". It's included in Visual Studio, but you don't need the entire VS for this purpose.
    Charlotte

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Flims, Switzerland
    Posts
    271
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Connecting to Sybase (Visual Basic 6.0)

    If your users simply need to view the Sybase table and modify it abritrarily, i.e. with no real checking or fancy functionality, then all you need essentially is some kind of editable 'grid' that the user can navigate around and enter data through.
    For this purpose, a linked table in Access might suffice, if your users have Access, that is.

  6. #6
    Lounger
    Join Date
    Sep 2001
    Location
    Philadelphia suburbs
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Connecting to Sybase (Visual Basic 6.0)

    Adam,

    I hope this question doesn't sound too silly, but I'm not sure what you mean by a "linked" table in Access. Is some kind of relationship set up between the Sybase table and the Access table. The reason I'm asking is I think I will have to add a great deal of functionality to the financial package we are using. I want to avoid setting up a lot of "shadow" databases.

    Thanks very much.

    Sue

  7. #7
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Flims, Switzerland
    Posts
    271
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Connecting to Sybase (Visual Basic 6.0)

    A linked table in Access is simply a table in an .mdb file which is linked to an external table somewhere else. For very simple 'view and edit' purposes it's a great way to play with a Sybase table, rather than writing SQL to do your select, inserts and updates.

    However, if this is part of a financial package then you might not want the user editing the table directly, and you probably want to wrap this functionality up in your front end somehow. It really depends on your circumstances. ADO is a huge subject and there are many ways to edit data in Sybase via ADO. You'd have to be more specific on what you want to do before anyone can help you write the code.

  8. #8
    Lounger
    Join Date
    Sep 2001
    Location
    Philadelphia suburbs
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Connecting to Sybase (Visual Basic 6.0)

    I need to create a table, dept_head, with only 2 fields--dept_head.code and dept_head.name. The Business Office will need to be able to modify the table as dept heads change, new departments are added, etc. I have a Crystal department expense report in place, and I want to be able to put the proper department head name on the report.

    Since I want to put the name on the report, I'm thinking it's probably best to place the tables right in Sybase. I think I can give the users who would modify this direct access to the tables. You're right that ADO is a huge subject. I've tried to research the best way to accomplish this, and I think I've only managed to confuse myself. Any suggestions or help that you can give would be much appreciated.

    Thanks,

    Sue

  9. #9
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Flims, Switzerland
    Posts
    271
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Connecting to Sybase (Visual Basic 6.0)

    What's your delivery platform? The web or the desktop?

    Do the users have ODBC access to the Sybase box? i.e. do they have the relevant server entries and DSNs on their machines?

    If so, and you just want them to have direct access to the table then just create an .mdb, link a table to your Sybase table, and hey presto! they have all the editing functionality the could possibly need.

  10. #10
    Lounger
    Join Date
    Sep 2001
    Location
    Philadelphia suburbs
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Connecting to Sybase (Visual Basic 6.0)

    Adam,

    Thanks for the information. The users do have ODBC access to Sybase from their desktop. I tried setting up the link in Access on my computer, and it worked fine. I did find that when I made a change to the table, then closed out of Access without saving, my changes were saved anyhow. Is there a way to close out without saving changes?
    Also, I was wondering about security considerations. Would this method be considered as secure going directly to the Sybase table?

    Thanks very much for your help.

    Sue

  11. #11
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Connecting to Sybase (Visual Basic 6.0)

    Any changes written into Access are saved as long as you move completely through the record. The exception is if a record is being edited and you close the application without completing the current record You can undo any record that hasn't been completed, but Access only allows you to work on one record per table at a time from the interface, so you can't edit a bunch of records and then decide not to save the edits, at least not without creating some code to write to an intermediate table or recordset before updating the ultimate table.
    Charlotte

  12. #12
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Flims, Switzerland
    Posts
    271
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Connecting to Sybase (Visual Basic 6.0)

    See Charlotte's reply to answer your question about editing, etc.

    As for security, if you want to validate users who want to edit the data using your linked table, then make sure you leave the 'Save password' checkbox unchecked when creating the linked table. That way your users will be asked to login to the Sybase box before they can see or edit the data.

  13. #13
    Lounger
    Join Date
    Sep 2001
    Location
    Philadelphia suburbs
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Connecting to Sybase (Visual Basic 6.0)

    Adam and Charlotte,
    Thanks very much for all your responses. If it's acceptable to the users, I will be going with the Access solution. If later on I decide to add some code, as Charlotte mentioned, to write to an intermediate table or recordset, could you point me in the direction of how to do this.

    Thanks again.

    Sue

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •