| Welcome to Webforumz.com. |
|
Nov 30th, 2005, 09:55
|
#1 (permalink)
|
|
Junior Member
Join Date: Nov 2005
Posts: 18
|
Database connection
Hi folks - just a quick question.
Is it possible to connect to a database that sits on a webserver using a script that sits on a local machine ?
If so, would the connection string look something like this :
sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("http://www.blah.cm/casinonewsxml.mdb")
The reason I ask, is because I have a vbscript that uses windows scheduling service to run at different stages during the day to update a database on a live server. I was wondering if it was possible to put this script on a local machine and make changes to the connection string.
I'm sure there are security issues etc, so any comments or input would be greatly appreciated. Or if you could think of any other ways I could do this, that would really help.
Thanks folks
|
|
|
Nov 30th, 2005, 11:55
|
#2 (permalink)
|
|
Highly Reputable Member
Join Date: Jul 2003
Location: Ipswich, UK
Posts: 755
|
Re: Database connection
i dont think it would work, but its worth a try. Personally i would put an asp page on the same server as the database and have it perform the tasks you want, then you can schedule that page to run from where ever you want.
__________________
Sam
~~~~~ poast.com ~~~~~
²²d(¬_¬)b²²
|
|
|
Nov 30th, 2005, 15:13
|
#3 (permalink)
|
|
Junior Member
Join Date: Nov 2005
Posts: 18
|
Re: Database connection
Cool - thanks Smokie
|
|
|
Dec 1st, 2005, 04:31
|
#4 (permalink)
|
|
Guest
|
Re: Database connection
If you were using MS SQL Server you could do that by connecting to the database server via its IP addresss.
|
|
|
|
Dec 1st, 2005, 09:47
|
#5 (permalink)
|
|
New Member
Join Date: Nov 2005
Age: 29
Posts: 3
|
Re: Database connection
Hi
In MS Access, its not possible. But in any server based database like MSSQL or mySQL, etc. its possible to connect using the IP or server URL.
Thanks.
[Edit: Spam Links Removed]
|
|
|
Dec 1st, 2005, 14:39
|
#6 (permalink)
|
|
Junior Member
Join Date: Nov 2005
Posts: 18
|
Re: Database connection
Thanks again.
I've decided to use MySQL database instead of the access database - access seems to be too flakey for this type of remote connection.
I have connected to a mysql database and have experienced a bit of a problem. I can insert and display info ok from the database, however when I try and enter in a date it doesn't seem to work. I believe its because mysql stores the dates as 0000/00/00 and asp does it the other way, 00/00/0000.
Any body know of any scripts or resources that might help me fix this?
Thanks folks.
|
|
|
Dec 5th, 2005, 14:12
|
#7 (permalink)
|
|
Reputable Member
Join Date: Sep 2003
Location: USA
Posts: 113
|
Re: Database connection
We are in the process of switching from Access to MySQL using an ASP app so I worte this script to translate dates into the MySQL format.
- Code: Select all
private function mySQLDate(oldDate)
dim y
dim mo
dim d
dim h
dim m
dim s
dim return
if isdate(oldDate) then
y = datepart("yyyy", oldDate)
mo = datepart("m", oldDate)
d = datepart("d", oldDate)
h = datepart("h", oldDate)
m = datepart("n", oldDate)
s = datepart("s", oldDate)
return = join(array(y, mo, d), "-")
if h+m+s > 0 then return = return & " " & join(array(h, m, s), ":")
end if
mySQLDate = return
end function
No warrently express or implied. 
HTH
__________________
jakyra
|
|
|
Dec 5th, 2005, 14:25
|
#8 (permalink)
|
|
Junior Member
Join Date: Nov 2005
Posts: 18
|
Re: Database connection
Quote:
|
Originally Posted by jakyra
We are in the process of switching from Access to MySQL using an ASP app so I worte this script to translate dates into the MySQL format.
- Code: Select all
private function mySQLDate(oldDate)
dim y
dim mo
dim d
dim h
dim m
dim s
dim return
if isdate(oldDate) then
y = datepart("yyyy", oldDate)
mo = datepart("m", oldDate)
d = datepart("d", oldDate)
h = datepart("h", oldDate)
m = datepart("n", oldDate)
s = datepart("s", oldDate)
return = join(array(y, mo, d), "-")
if h+m+s > 0 then return = return & " " & join(array(h, m, s), ":")
end if
mySQLDate = return
end function
No warrently express or implied. 
HTH
|
Thats great - thanks man.
|
|
|
| Thread Tools |
|
|
| Rate This Thread |
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|