|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
changing from access to MS SQL
At the moment I have an MS Access database and is getting full very quickly.
I want to upgrade to a MS SQL database provided by my hosting provider. My current site is written in ASP and SQL, I want to know would I have to allter any SQL or ASP coding to make it compatible with the MS SQL database instead of access. This is an example of the coding that I am using at the moment to perform searches. Code:
<%
' Open the Database Connection
SET Conn = Server.CreateObject("ADODB.Connection")
sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("\********.mdb") & ";" & _
"Persist Security Info=False"
Conn.Open(sConnection)
%>
I know that I will need to change the connection to the database but that is all that I know what has to be changed. Below is just a SQL sample that is used on my site. (I am using sessions below because the 2 pages before are secure credit card pages, so I have to write them to a session variables before going through the 3rd party servers). Code:
<%sqlString1 = "INSERT INTO jobs " &_
"( accountNo,jobtitle,category,jobtype,salary,benefits,location,jobdescription,companyname,companytype, contact,email,phone,reference,method,VendorTxCode )" &_
"VALUES( " &_
"'" & Session("accountNo") & "'," & _
"'" & Session("jobtitle") & "'," & _
"'" & Session("category") & "'," & _
"'" & Session("jobtype") & "'," & _
"'" & Session("salary") & "'," & _
"'" & Session("benefits") & "'," & _
"'" & Session("location") & "'," & _
"'" & Session("jobdescription") & "'," & _
"'" & Session("companyname") & "'," & _
"'" & Session("companytype") & "'," & _
"'" & Session("contact") & "'," & _
"'" & Session("email") & "'," & _
"'" & Session("phone") & "'," & _
"'" & Session("reference") & "'," & _
"'" & Session("method") & "'," & _
"'" & VendorTxCode & "')"
Conn.Execute(sqlString1)
%>
Thanks in advance. |
|
#2
|
||||
|
||||
|
there are plenty of sites out there that will describe the conversion procedure, and in fact i think you can even get a utility from microsoft to help convert the sql
there are a number of things that you will have to check for in your sql IIF is replaced by CASE FORMAT has no straight equivalent, use CONVERT to format dates DATEADD, DATEDIFF, etc, have slightly different formats dates are delimited by singlequotes, not octothorps, i.e. #2003-10-29# becomes '2003-10-29' multi-table joins no longer need parentheses, but be careful of these, some may need to be re-written saved queries, used in the FROM clause, can be rewritten as VIEWs, or better yet, derived tables other than that, and i'm sure a few other tidbits i've forgotten, it's a fairly easy conversion ![]() rudy http://r937.com/ |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > changing from access to MS SQL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|