Accessing a remote MS Access database from PHP 5.3 / IIS7 - iis-7

I am trying to connect to an ms access database that is in our company network.I have installed IIS7 and PHP 5.3 .For that I have copied the database from the remote computer to my PC and it works fine.But I don't want to copy the database every time.So,I need to connect to that database remotely in PHP. I have not find any simple way.
For locally access the database ,i have configured
Control Panel\All Control Panel Items\Administrative Tools\system DSN and add the database path.
$conn=odbc_connect("dbname","" ,"");
Any help would be appreciated.

Related

Problem publishing ASP.NET application with a SQL Server database

I've created an ASP.NET website which runs perfectly from Visual Studio. It connects to a SQL Server .mdf database file in the App_Data folder. I published the project using FTP. The live website cannot however connect to the database, as it is LocalDB, and my host uses a SQL Server (SqlException (0x80131904))
I uploaded an identical copy of the local .mdf database file from my computer to the host's SQL Server. I then tried to form a data connection with the server database from Visual Studio, however my host doesn't allow remote database access, for security reasons, resulting in error 40.
I'm using ASP.NET MVC in my application so I need access to the database to create models. My host has said "you can access SQL Server databases using ASP scripts running on your presence".
So my question is: how do I create models based on my host's SQL Server database when remote access isn't allowed?
When you're testing with Visual Studio, you should connect to the local copy of your database. When you're ready to publish your application, copy the database to the remote sql server and attach it. The copy of your application which is published should then connect to the uploaded database on that server.
That way you have one environment for testing and one for real use. There shouldn't be any need for Visual Studio to connect to the remote database.
P.S. To allow you to connect to different databases in different environments, usually you set your database connection string in the web.config file. So if you create different config transforms for each build configuration (e.g. debug and release) then visual studio will create the correct version of the config file when you do a Publish operation. See https://learn.microsoft.com/en-us/aspnet/web-forms/overview/deployment/visual-studio-web-deployment/web-config-transformations for info about configuration transforms.

how does IdentityDbContext know my password?

using visual studio 2013 I created an ASP.NET MVC 5 project. I copied my database from the automatically created file to a server running MS SQL Server. However, when I created the connection string, all I specified was the ip address and the database name. It connects fine; I updated some data on the server and that data shows up. But how? I never told it the username or password I use to connect. Perhaps does Server Management Studio save that data somewhere that my application is apparently searching?

Simple ASP.net SQL Server database editor application

I have a website externally hosted, to which I have FTP access, however it is not a dedicated server so I can't directly connect to SQL Server. I have the database connection string from the web.config file.
I need to edit the database directly, but obviously tools like SQL Server Management Studio aren't going to work.
Is there a (free) simple database editing application available that will run directly alongside the website on the same server? I HAD one for classic asp years back but have always run dedicated servers since...
Actually you can access a database from a service like GoDaddy that is hosted with shared hosting through SQL Server. Check this link: http://support.godaddy.com/help/article/4978/connecting-remotely-to-shared-hosting-databases. GoDaddy says that you could even use the SQL Server Express edition to access your database directly and remotely but you must enable Direct Database Access when setting it up.

No access to Database File

Last week I created a ASP.NET Web Application project on my machine. It was connecting to a SQL server database file for testing. The database was created in the server explorer part of visual studio and it created a database file with all of the information within it. I was using windows authentication to connect to the database.
Recently my computer has been migrated onto a new netowrk within my company. Now I no longer have access to the database file. The error I am getting is Login failed for user "DOMAIN/USER". I guess this is because the Domain has changed and my computer and the database server are in different domains. However I do not have access to the old domain to add a new login or user with priveladges to access the database.
How can i get arround this?
You cannot get around this, unless an admin is willing to give you a copy of the files from the old drive.
So, you must re-create your database.
Fortunately, if you took proper precautions, this will be easy.
Option 1: If your database is under source control, simply checkout the latest good version of the database.
Option 2: Load the latest backup of the database.

Publishing ASP.NET site - No login database?

I have a very simple app on my local machine that uses the ASP.NET membership provider. This works fine on my local machine.
I have published the app to our web server, and I need to know the specifics of setting up the application for asp.net membership to work.
I have a basic understanding that it uses an MDF file and somehow connects to a SQL database (SQLEXPRESS I assume on my local machine) which holds the user/role information.
I keep getting an error that it cannot connect to a SQL database when running the published application on the web server.
I wish to use a SQL server on a different machine (SQL69) than my web server (WEB69)
I have created a new connection string, but how do I tell ASP.NET to use it instead of the "LocalSqlServer" connection string that is created by default?
Can someone explain what is required to me?
Thanks for any help you can offer.
Use the ASP.NET SQL Server Registration Tool without any parameters to set up the SQL Server membership on your local machine. This will also update your config file:
http://msdn.microsoft.com/en-us/library/ms229862%28VS.80%29.aspx
You need to set up SQL Server DB membership on your local machine first. After you have this working, you can simply script the entire DB for your production environment. For this, you can use the Database Publishing Wizard in VS.
You can view a sample config file here:
http://www.codersbarn.com/post/2008/02/24/ASPNET-20-Guest-Book-Admin-Part-II.aspx

Resources