Hi Guys.
Found an b4a app that was made to test connection to database, and this program CANNOT connect to the database either, i have attached photo from the app with information, and also from VB.net in which you can see it connects just fine, is there something stupid im missing here ?
that was me. I not really sure I should jump in this thread. However, your vb.net connection works because I assume you are on the SAME network as the server. But you using a server name - you cannot do that in B4A with a direct connect, because your android does not have windows networking, and you can't thus use a server name, but must use IP address. So, just because your android is connected to the same network (not phone data connection), but a known local LAN connection, then even then, there is no computer name resolution available. You have to use IP address. You can no more see a list of network computers, or see computer names - that requires a windows networking stack and system. You don't have that. So, assuming that your phone is valid and connected to the same network. (not outside connection), then that sample should work fine. But anything you connect to on that network will require IP address, since no windows networking name resolution is available. So, I would first use SSMS and not even vb or any other code. If you can connect by IP address, then the sample I have should work just fine.
So, say if SSMS running on wi-fi from a laptop can connect to the database with IP address? Then the phone and that sample will also connect. If your same laptop on the same wi-fi with SSMS studio can't connect, then your phone will not either.
EDIT:
And where in your connection VB.net example do we see/find/have/use "MSSQL" what kind of GUESS was that?
Where???
Your tossing in MSSQL, yet you don't have that ANY place in your vb.net connection here.
You have this: servername\SQL INSTANCE NAME
And to be specific? What does the above mean?
It means this:
SERVER NAME = bendanisoftwarecom
DATABASE INSTANCE NAME = CORTSENDB
So, why are you typing in BOTH server name and database instance name for the server name?
You need:
SERVER NAME " BENDANISOFTWARE.com, but as I stated, you must use IP address.
And then you have for the database instance: MSQL? where did that come from?
In that connection box, you don't type in both server + server instance name. But, that should have been dead obvious since there is a box for the sql server instance name. Your vb.net connection string allows both sql server name + sql instance name to be combined for the server\SQL instance name.
However, to reduce confusing (and that when using jdbc to sql server, you do NOT include the sql instance in the server connect name. They are separate, and I did that on purpose in that connection tester to eliminate this confusing, but also to make it quite obvious that you ONLY enter the server name (and as noted, as a IP address).
And I am always short of time, but that connection tester was written to help you test without having to write any code.
And I been just too busy - not been around here for 3months. But I been meaning to extend that sql tester to scan the network for valid sql servers, but its at least a start. You should be able to just enter the server name (ip address), the sql instance and the other information and touch connect. However, do keep in mind that when using jdbc for SQL server, the database instance name is 100% separate from the server name - and that includes the connection string.
it goes without saying? You want to be aware of the difference between the server name, and WHAT a database instance is! Without this basic concept, then you keep entering the server + database instance for the server name when using jdbc, and all will be for not.
And as noted, anytime you do ANYTHING with android when connected to a local network? You don't have name resolution, and thus can't as a general rule connect to anything at all by name, but only by IP address.
Regards,
Albert D. Kallal
Edmonton, Alberta Canada