ADO control in VB

They have: 111 posts

Joined: Jun 2006

Is it possible to call backend procedures with ADO control in VB?

SBalan Group
http://www.sbalanprojects.com/

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

By backend procedures do you mean Stored Procedures on some SQL Server? Secondly are you using VB6 or VB.NET, I can check in VB6 but would have to go a little further to find out for .NET Smiling

a Padded Cell our articles site!

They have: 111 posts

Joined: Jun 2006

Hi JeevesBond...
Yes, it is Stored Procedures. Its ok if u can let me know how the same can be done using VB6.

Thanks:)
SBalan Group
http://www.sbalanprojects.com/

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

Well, I don't use .NET (and when I do it'll probably be under Linux Wink ), so it'll have to be VB6! Here're the steps I used to hook up an ADO control to one of our SQL Servers:

  1. Started new standard exe VB project.
  2. Added an ADO Control to the form provided (this is msadodc.ocx you're asking about isn't it?).
  3. In the properties box for the ADO control I navigated to the "Connection String" property, and started the wizard by clicking on the ...
  4. From the dialog I then opted to "Use Connection String" and clicked the "Build..." button.
  5. From the next dialog I selected "Microsoft OLE DB Provider for SQL Server" then clicked "Next"
  6. I then filled out the server name, selected Integrated NT Security, selected the Database and then clicked "Test Connection". If this fails you need to scrutinise your settings thoroughly. Smiling
  7. After all that I ended up with a connection string that looks like this:
    Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=ExecUKTest;Data Source=EXECDEV'
  8. I pressed ok and now have the connection to my server.
  9. Then selected the "RecordSource" property's "..." to bring up another dialog.
  10. In that dialog selected a Command Type of "4 - adCmdStoredProc".
  11. Then selected the "Table or Stored Procedure Name" drop-down box, which gave me a list of the Stored Procedures available on the SQL Server.

That should do it for you. Hope that helps. Smiling

a Padded Cell our articles site!

They have: 111 posts

Joined: Jun 2006

Hey thanks JeevesBond.

SBalan Group
http://www.sbalanprojects.com/

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.