question

SPramanik-4191 avatar image
0 Votes"
SPramanik-4191 asked SeeyaXi-msft commented

Migration of Online Form created in Expression Web

I need to change the Access Database connection to SQL Database server connection in Online Form created in Expression Web. The files are .asp not .aspx. Can that be done in EW? Following is the driver need to be replaced.

strConn="Driver={Microsoft Access Driver (.mdb, .accdb)};Dbq=d:\websurveys\xyz.accdb;Uid=;Pwd=;"

 Set conn = Server.CreateObject("ADODB.Connection")
 conn.Open strConn


ANY HELP IS HIGHLY AI need to change the Access Database connection to SQL Database server connection in Online Form created in Expression Web. The files are .asp not .aspx. Can that be done in EW? Following is the driver need to be replaced.

strConn="Driver={Microsoft Access Driver (.mdb, .accdb)};Dbq=d:\websurveys\xyz.accdb;Uid=;Pwd=;"

 Set conn = Server.CreateObject("ADODB.Connection")
 conn.Open strConn


Do I need to rebuild the forms in Visual Studio? Any help is highly appreciated.

sql-server-general
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @SPramanik-4191,

We have not received a response from you. Did the reply could help you? If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. By doing so, it will benefit all community members who are having this similar issue. Your contribution is highly appreciated.

0 Votes 0 ·
cooldadtx avatar image
0 Votes"
cooldadtx answered

Change the strConn variable. I'm guessing at the syntax but the docs are here.

strConn = "Provider=SQLOLEDB;Data Source='MySqlServer';Initial Catalog='MyDatabase';Integrated Security='SSPI;"


Note that SQL syntax between Access and SQL is different so you'll also need to adjust all your queries accordingly.

Since you have the connection string hard coded in your code then yes you'll need to rebuild it but I don't think Visual Studio supports ASP anymore. That is several decades old code. It does support ASPX which has far better support but that would be a huge change to transition from Classic ASP to ASPX.

But the other thing I'm wondering about is Expression Web. The only context I've heard of the product for is ASPX so mentioning ASP is odd.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

SPramanik-4191 avatar image
0 Votes"
SPramanik-4191 answered cooldadtx commented

Thanks for your answer. My question is if I change the connection string and queries and leave the file as .asp, will it work?

Since the website was buit using Expression Web, if the forms built in future in Visual Studio, what the best option is to use Visual Basic WebForm or Visual C#?

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

You have to recompile the app if you modify the server side stuff like queries and connection strings as it is baked into the code.

For current web development the general recommendation is using ASP.NET Core MVC using Razor. That is pretty much the defacto but Razor Pages (a variant of MVC) is a lightweight version that may be more maintainable. If you have a heavy scripting investment and aren't comfortable with Javascript then Blazor is something to look into as well. You can read more about them here and here.

0 Votes 0 ·
SPramanik-4191 avatar image
0 Votes"
SPramanik-4191 answered cooldadtx commented

If the website was developed in EW and all the existing pages and forms are not migrated, how ASP.NET C# Web Form works?

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

You have to migrate from ASP to ASPX. You cannot use .NET otherwise. If you don't want to migrate then you'll have to make your changes in Expression Web if you can still find a copy. But I know nothing about that product so I cannot answer to specifics. There are many articles you can read about such a migration (keeping in mind some are trying to sell a product).

https://stackoverflow.com/questions/111071/how-do-i-convert-legacy-asp-applications-to-asp-net
https://www.mikesdotnetting.com/article/225/migrating-classic-asp-to-asp-net-razor-web-pages-part-one-razor-syntax-and-visua
https://www.keenesystems.com/blog/benefits-and-challenges-of-classic-asp-to-asp.net-migration

0 Votes 0 ·
SPramanik-4191 avatar image
0 Votes"
SPramanik-4191 answered cooldadtx commented

The website created in EW is heavily used, so migrating will be time consuming. But if I create the new form using ASP.NET C# and can it be deployed as .aspx application from the existing website?

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

No. An ASP.NET application is completely independent of ASP. It requires a runtime that is hosted in IIS and configured for .NET. An ASP app wouldn't have that although in theory an ASP app could be hosted in ASP.NET, never tried it.

If all you're doing is changing the connection string though then just recompile the old code. If you need to make additional changes then consider a migration instead. To get this to work you'll have to host 2 sites: the old and the new one. Depending upon what you're doing you can set up a root IIS site and host each app as virtual apps underneath. You'll have a lot of work to do bouncing the user between the 2 apps and you'll have to handle things that won't work together like session data and security. It really depends upon your app.

But a question like that should probably be its own question in the forums as it is unrelated to changing a connection string from Access to SQL as this post started at.

0 Votes 0 ·
SeeyaXi-msft avatar image
0 Votes"
SeeyaXi-msft answered

Hi @SPramanik-4191,

Here is the steps: https://www.engineeredit.com/database-consulting/convert-access-to-web
Hope this is useful.

Best regards,
Seeya


If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar queries.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.