Please be aware that the SAP SQL Anywhere Forum will be shut down on August 29th, 2024 when all it's content will be migrated to the SAP Community.

After looking and reading for a while, I am posting the question.

VB6, I want to do a pop up window showing the servers found on a network. Then of course allow the user to select. I can use dblocate from cmd prompt. I have not been able to find the command to do this as the "FIND" option does in ISQL-10 .

Can someone be kind enough to point me in the right direction. I seem to be overlooking it. I can use a shell call, but that does not seem clean. Am I just overlooking it.



asked 04 May '12, 15:41

George's gravatar image

accept rate: 0%

You'll probably need to use the DBTools API.

(04 May '12, 18:42) Calvin Allen

Thanks for the lead. I will see what is there. Appreciated

(04 May '12, 18:45) George

"I can use a shell call, but that does not seem clean."

What exactly do you mean? Do you generally want to avoid a shell call, or does it not work as expected?

AFAIK, Calvin's hint to the DBTools API won't work, as there is no according DBLocate() function (or at least I'm not aware of one).

The DBLOCATE tool itself uses a dblibX.dll function, see the discussion in this FAQ on dblocate vs. dbping.

FWIW, the according function is called db_locate_servers_ex function. As this (like the DBTools API functions) is a C-based API, I don't know how difficult it is to call this (including the needed callback function) from VB6.

IMHO, calling the external DBLOCATE utility (with the -o and -q options, I recommend) and parsing the according message log file (as specified by -o) would seem much easier.

permanent link

answered 05 May '12, 06:08

Volker%20Barth's gravatar image

Volker Barth
accept rate: 34%

edited 05 May '12, 15:38

Glad I didn't put that as an answer then :)

(05 May '12, 09:21) Calvin Allen

I don't know how difficult it is to call this (including the needed callback function) from VB6.

Not difficult if you have knowledge of both C and VB6, and have compile environments set up for both. Many VB6 programmers are very used to making external DLL calls over COM. I have even seen VB6 programs calling into .NET environments (which is even crazier, IMHO. :)

There are also samples available in the SQL Anywhere directory on how to compile C code for ESQL programs (%SQLANYSAMP10%\SQLAnywhere\ESQL*) - these create .exe files by default, but if you add "/DLL" to the compile line, you can get a .DLL outputted instead. To create the export links from C to VB, You'll gave to create an export .def file, or add "__declspec()" calls to the C code.

(07 May '12, 10:32) Jeff Albion
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 04 May '12, 15:41

question was seen: 3,451 times

last updated: 07 May '12, 11:15