iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > Classic ASP

Reply
 
LinkBack Thread Tools
Old November 30th, 2005, 06:55 AM   #1
New Member
 

Join Date: Nov 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 fogofogo is on a distinguished road
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
fogofogo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 30th, 2005, 08:55 AM   #2
Highly Reputable Member
 

Join Date: Jul 2003
Location: Ipswich, UK
Posts: 686
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Smokie will become famous soon enough
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.
Smokie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 30th, 2005, 12:13 PM   #3
New Member
 

Join Date: Nov 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 fogofogo is on a distinguished road
Re: Database connection

Cool - thanks Smokie
fogofogo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 1st, 2005, 01:31 AM   #4
Anonymous User
Guest
 

Posts: n/a
Re: Database connection

If you were using MS SQL Server you could do that by connecting to the database server via its IP addresss.
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 1st, 2005, 06:47 AM   #5
New Member
 

Join Date: Nov 2005
Age: 31
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 hostndomain is an unknown quantity at this point
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]

Last edited by Rob; December 1st, 2005 at 12:07 PM..
hostndomain is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 1st, 2005, 11:39 AM   #6
New Member
 

Join Date: Nov 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 fogofogo is on a distinguished road
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.
fogofogo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 5th, 2005, 11:12 AM   #7
Reputable Member
 

Join Date: Sep 2003
Location: USA
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 jakyra is on a distinguished road
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:
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 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old December 5th, 2005, 11:25 AM   #8
New Member
 

Join Date: Nov 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 fogofogo is on a distinguished road
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:
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.
fogofogo is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Tags
database , connection


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Database Connection Error Message Monie Classic ASP 6 November 2nd, 2007 06:08 AM
[SOLVED] Easiest way to open database connection! Monie Databases 4 November 1st, 2007 05:35 AM
Connection to access database thriftyspider Other Languages 1 August 7th, 2007 05:41 PM
another database connection question! asp and mysql fogofogo Classic ASP 4 December 2nd, 2005 05:48 AM
Database Connection Strings Smokie Classic ASP 0 August 7th, 2003 06:51 AM


Search Engine Optimization by vBSEO 3.2.0 RC8