Web Design and Development Forums

Database connection

This is a discussion on "Database connection" within the ASP Forum section. This forum, and the thread "Database connection are both part of the Program Your Website category.


Go Back   Webforumz.com > Program Your Website > ASP Forum

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old 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
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 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²²
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 Nov 30th, 2005, 15:13   #3 (permalink)
Junior Member
 
Join Date: Nov 2005
Posts: 18
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 Dec 1st, 2005, 04:31   #4 (permalink)
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 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]

Last edited by Rob; Dec 1st, 2005 at 15:07.
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 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.
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 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
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 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.
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

Tags
database, connection

Thread Tools
Rate This Thread
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

vB 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 ASP Forum 6 Nov 2nd, 2007 08:08
[SOLVED] Easiest way to open database connection! Monie MSSQL & Access 4 Nov 1st, 2007 07:35
Connection to access database thriftyspider Java, JSP, Cold Fusion 1 Aug 7th, 2007 20:41
another database connection question! asp and mysql fogofogo ASP Forum 4 Dec 2nd, 2005 08:48
Database Connection Strings Smokie ASP Forum 0 Aug 7th, 2003 09:51



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 23:58.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
SEO by vBSEO 3.1.0


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59