Want to change sql server

M

Max Achmeier

Hi NG,
at the moment my sql server is on the same machine as the msp server 2002.
We installed a zentralized sql server.
How can I move the projectserver database to the standalone sql server and
let the projectserver talk to this new sql server on another physical machine?
Thanks for all your help.
Regards,
Max
 
N

Nirvan Biswas

Specify what database you use (e.g : Ms Access).
Make a file DSN from ODBC32 in Control Panel to get the connection string
(this step is not necessary if you know the connection string to use for your
database).
Double Click on ODBC32 icon.
On ODBC Data Source Administrator dialog, choose File DSN and click Add
From Create New Data Source dialog, choose which type of database you use
and click Next
Type the name of your new File DSN e.g. "test" (click browse to specify
another folder where your File DSN file reside). Click Next and then Finish.
For Ms Access and Ms Excell type, you must tell the dialog where your
database is. It will ask you for a database name. In this cases, select any
database name on your computer.
Open the DSN file using any text editor. Usually it resides on "C:\Program
Files\Common Files\ODBC\" folder.
Use that string on your ODBC connection in global.asa with changes on the
"DefaultDir" (or the "DBQ Value" on Ms Access file) string value.
The changes on DefaultDir (or DBQValue) will be generated on the fly and
then stored on a Session variable.



' Automatic DataConnection
ScriptName = Request.ServerVariables("SCRIPT_NAME")
tmpScriptName = Mid(ScriptName,2)
intPos = Instr(tmpScriptName,"/")
VirtualDir = Left(tmpScriptName, intPos - 1)
AbsolutePath = Server.MapPath ("/" & VirtualDir)
DBQValue = "DBQ=" & AbsolutePath & "\YourDatabaseName.mdb"
' the string below is a duplicate string from the DSN file.
Session("DataConn_ConnectionString") = _
"DRIVER=Microsoft Access Driver (*.mdb);" & _
"UID=admin;" & _
"UserCommitSync=Yes;" & _
"Threads=3;" & _
"SafeTransactions=0;" & _
"PageTimeout=5;" & _
"MaxScanRows=8;" & _
"MaxBufferSize=512;" & _
"ImplicitCommitSync=Yes;" & _
"FIL=MS Access;" & _
"DriverId=25;" & _
"DefaultDir=;" & _
' you can change this DefaultDir

' DBQValue is generated on the fly
DBQValue

' End of Automatic DataConnection


Your database must be stored within the virtual directory If you specify
another directory within your virtual directory to store your database (e.g.
/VirtualDir/DataBase/MyData.mdb), you must change DBQValue variable with :
DBQValue = "DBQ=" & AbsolutePath & "\DataBase\YourDatabaseName.mdb"

To Use the connectionn string that we produce, from any asp file, simply use
this code :


<%
Set DataConn = Server.CreateObject("ADODB.Connection")
DataConn.Open Session("DataConn_ConnectionString")
%>


Note :

Your virtual directory must reside on a directory without spaces. I have
trouble to connect my database when I put my virtual directory on such
directory.
You can also use a shorter connection string without add another string
value such as UID, PWD etc. depend on the ODBC Driver you use. Here's the
long connection string that I used:


' Automatic DataConnection
ScriptName = Request.ServerVariables("SCRIPT_NAME")
tmpScriptName = Mid(ScriptName,2)
intPos = Instr(tmpScriptName,"/")
VirtualDir = Left(tmpScriptName, intPos - 1)
AbsolutePath = Server.MapPath ("/" & VirtualDir)
DBQValue = "DBQ=" & AbsolutePath & "\YourDatabaseName.mdb"

' the string below is a duplicate string from the DSN file.
' This value is generated on the fly
Session("DataConn_ConnectionString") = _
"DRIVER=Microsoft Access Driver (*.mdb);" & _DBQValue

' End of Automatic DataConnection
 
M

Max Achmeier

Hi Nirvan Biswas,

many thanks for your quick answer.
You wrote something about MS Access.
But my problem is to migrate the projectserver database from one sql-server
to another.
At this moment e.g. my projectserver AND sql-server IP is 149.247.109.13.
Now the sql-server is on 149.247.109.27 and the projectserver is still on
109.13.
How can I manage this?
Thx a lot.
Regards Max
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top