Android Question SQL Server - script - b4a(+Remote)

luisro

Member
Licensed User
Hello, my questions are based on this tutorial:

https://www.b4x.com/android/forum/threads/connect-android-to-ms-sql-server-tutorial.13166

I have this series of questions if they are so kind:

1) Using (SqlConnection cn = new SqlConnection("Database=USER\SQLEXPRESS; User Id=USER-Pc\USER-Pc; password="))

- What's in bold is that or databasename?

2) The address of my db is: C: \ Program Files \ Microsoft SQL Server \ MSSQL10_50.SQLEXPRESS \ MSSQL \ DATA \ Database

- Where would it go is ASPX script?

3) I have installed the following programs that works with our program of administration of the company:

-Microsoft . NET Framework 4.6.1
-Microsoft SQL server 2008 R2
-Microsoft SQL server 2008 R2 Native
-Microsoft SQL server browser
-Microsoft SQL server vss writer
-S.O Windows Server 2003

I am already perfectly connected to a database on a web server using php script, but I do not know if the procedure is the same for this case.

-https://www.b4x.com/android/forum/threads/connect-android-to-mysql-database-tutorial.8339/

I do not know if the questions are very silly, but I think it is more stupid not to seek help and not achieve their goals.

Greetings.
 

sorex

Expert
Licensed User
Longtime User
php can connect to your MSSQL database aswell if you enable the right SQL driver in apache.

if everything on local servers? or was the php one on some hosted webserver?
 
Upvote 0

luisro

Member
Licensed User
That is to say, I already had a positive experience connecting through a php script, both to a local server and to a remote server (phpmyadmin).

So, I need to connect to the administration program of the company, and I only know that I can manage it with sql server, it is in this address: C: \ Program Files \ Microsoft SQL Server \ MSSQL10_50.SQLEXPRESS \ MSSQL \ DATA


I understand that I connect through an aspx script (just like I connect with the php script), perout where do I store the script? Do i need any additional extension? in the example of the php script I store it in the folder www (localhost XAMP) or in PUBLIC (our domain) but here where the script is stored?

SS-2011-12-11_16.03.27.png


My case, I need to consult the inventory of products of the company's administrative system, I can not migrate the database of its address which is: C: \ Program Files \ Microsoft SQL Server \ MSSQL10_50.SQLEXPRESS \ MSSQL \ DATA
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
As every DB server MSSQL provides a server instance which you can connect to (like MySQL does the same). So you need to get to know the address of the SQL Server (like localhost or more likely another address). In my company we use seperate servers. The rest is done by a connection string (Servername, DBName, PW, etc.).

https://msdn.microsoft.com/de-de/library/ms228094(v=vs.85).aspx

So you have to create your aspx script which ittself may access the db server and db. Ask the company's administrator how to do that. Same with "where do I have to put the script". It must be a server which can process aspx (like apache) = webserver accepting calls. Maybe they have one server for both. Ask your administrator how they have done it.

App -> webserver with aspx -> aspx script -> ms sql db
 
Upvote 0

luisro

Member
Licensed User
Well, finally I was able to perform a query in sql server, incredibly this description was the key App -> webserver with aspx -> aspx script -> ms sql db.

I solved it with wamp server and php script and perfect.

Thank you.

Now, lastly I need to do the consultations from any place remotely.

Some tutorial to connect with the script hosted on the wamp server and if it is possible to provide security?

Modem - Router - windows server 2003
 
Last edited:
Upvote 0
Top