• Connecting to Sybase (Visual Basic 6.0)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Connecting to Sybase (Visual Basic 6.0)

    Author
    Topic
    #360649

    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

    Viewing 1 reply thread
    Author
    Replies
    • #543634

      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.

      • #543807

        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

        • #543816

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

    • #544192

      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.

      • #544195

        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

        • #544197

          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.

          • #544230

            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

            • #544369

              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.

            • #544569

              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

            • #544644

              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.

            • #544660

              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.

            • #544819

              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

    Viewing 1 reply thread
    Reply To: Connecting to Sybase (Visual Basic 6.0)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: