D
Daniel
I am trying to help a colleague to backup his website to migrate it
elsewhere. As such, I am trying to figure out how I can using ASP
perform a backup to my hard drive of the entire db (it is actually
very small). The host provides no admin console, so I have none of the
usual tools to create a backup. Thus the question.
The host is being more than difficult to work with. They were asked
for a backup and they refused to provide one. So now I am trying to
find a way to do it myself.
I have been trying to use the following but it doesn't seem to produce
any results?
<%
SQL_Server_Name = "servername"
DB_Name = "dbname"
DB_User_ID = "username"
DB_Password = "password"
strcon = "Provider=SQLOLEDB;Data Source="& SQL_Server_Name
&";Initial Catalog=" & DB_Name &";User ID="& DB_User_ID &";Password="&
DB_Password&";charset=utf-8"
set con = Server.CreateObject("ADODB.Connection")
con.Open strCon
sql="BACKUP DATABASE ["& DB_Name &"] TO DISK = N'c:/db.bak' WITH
NOFORMAT, NOINIT, NAME = N'backup', SKIP, NOREWIND, NOUNLOAD, STATS =
10"
con.Execute(sql)
%>
Since I am running the script on the server, I suppose it is being
saved to the server rather than on my hard drive. What do I need to
do to be able to save it to my drive or e-mail it or so method I can
actually get a copy?
Also worth explaining. The website files are hosted on one server
while the db is on another. So the Backup file is not on the local
computer with the asp files... I tried to add an e-mail routine but
the server running the asp file cannot locate the file (as it is
actually on another machine, I assume is the reason).
Please keep in mind I know next to nothing about both SQL Server and
ASP. I truly am just trying to help someone who is completely
technologically ignorant out of a mess.
Also, I am using the credentials given by the Host. Is there a
simple way to find out if they have the required permissions to
perform a backup? I was simply wondering if it wasn't a permission
issue.
I have also tried to connect my server (SQL Server 2008) to the remote
server using the supplied credentials, but it doesn't work and returns
an error #53...?
Thank you very much for your help!!!
QB
elsewhere. As such, I am trying to figure out how I can using ASP
perform a backup to my hard drive of the entire db (it is actually
very small). The host provides no admin console, so I have none of the
usual tools to create a backup. Thus the question.
The host is being more than difficult to work with. They were asked
for a backup and they refused to provide one. So now I am trying to
find a way to do it myself.
I have been trying to use the following but it doesn't seem to produce
any results?
<%
SQL_Server_Name = "servername"
DB_Name = "dbname"
DB_User_ID = "username"
DB_Password = "password"
strcon = "Provider=SQLOLEDB;Data Source="& SQL_Server_Name
&";Initial Catalog=" & DB_Name &";User ID="& DB_User_ID &";Password="&
DB_Password&";charset=utf-8"
set con = Server.CreateObject("ADODB.Connection")
con.Open strCon
sql="BACKUP DATABASE ["& DB_Name &"] TO DISK = N'c:/db.bak' WITH
NOFORMAT, NOINIT, NAME = N'backup', SKIP, NOREWIND, NOUNLOAD, STATS =
10"
con.Execute(sql)
%>
Since I am running the script on the server, I suppose it is being
saved to the server rather than on my hard drive. What do I need to
do to be able to save it to my drive or e-mail it or so method I can
actually get a copy?
Also worth explaining. The website files are hosted on one server
while the db is on another. So the Backup file is not on the local
computer with the asp files... I tried to add an e-mail routine but
the server running the asp file cannot locate the file (as it is
actually on another machine, I assume is the reason).
Please keep in mind I know next to nothing about both SQL Server and
ASP. I truly am just trying to help someone who is completely
technologically ignorant out of a mess.
Also, I am using the credentials given by the Host. Is there a
simple way to find out if they have the required permissions to
perform a backup? I was simply wondering if it wasn't a permission
issue.
I have also tried to connect my server (SQL Server 2008) to the remote
server using the supplied credentials, but it doesn't work and returns
an error #53...?
Thank you very much for your help!!!
QB