Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


server.mappath


server.mappath

Author
Message
nn
nn
Forum God
Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)

Group: Forum Members
Posts: 49, Visits: 13
I am newbies in asp web development..i had a problem when after i uploaded my web to server.i couldn't find my database when i trying to login.i am using server.mappath("../register/db1.mdb")



when i use it in my local pc i am using it like this server.mappath("db1.mdb") .it's working...



i name my path "../register/db1.mdb" because i have a domain name infront of it. something like this.



http://www.lookup.com.my/register/db1.mdb



please help me...
johnboy891
johnboy891
Forum God
Forum God (79K reputation)Forum God (79K reputation)Forum God (79K reputation)Forum God (79K reputation)Forum God (79K reputation)Forum God (79K reputation)Forum God (79K reputation)Forum God (79K reputation)Forum God (79K reputation)

Group: Forum Members
Posts: 545, Visits: 1K
why not use the absolute path instead of the relative one you're using now?  the "../" is telling the app to look in the parent directory of the directory it is currently browsing.  just use the whole thing.. or see if you can use the <BASE> tag somewhere (sorry, though, i know nothing about asp, but this problem doesn't seem asp specific).
Mod
Mod
Moderator
Moderator (13K reputation)

Group: Moderators
Posts: 78, Visits: 255
Server.MapPath translates a virtual path to a physical path. Your virtual path is,

/register/db1.mdb  'Pass this to the Server.MapPath function

Server.MapPath("/register/db1.mdb")


Regards,

Forum Moderator

nn
nn
Forum God
Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)

Group: Forum Members
Posts: 49, Visits: 13
i had you used both of it. using the absolute path and also "/register/db1.mdb".but when i upload it to server with domain name .i can't even access the database.So is there an alternative solution for it.Thanks.
johnboy891
johnboy891
Forum God
Forum God (79K reputation)Forum God (79K reputation)Forum God (79K reputation)Forum God (79K reputation)Forum God (79K reputation)Forum God (79K reputation)Forum God (79K reputation)Forum God (79K reputation)Forum God (79K reputation)

Group: Forum Members
Posts: 545, Visits: 1K
my experience with working with urls and internet paths is that they're case-sensitive a lot of times.  do the casings of your url/db match up?
nn
nn
Forum God
Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)

Group: Forum Members
Posts: 49, Visits: 13


Can i know how to do casting in asp code..I'm still new in asp.so hope you can help me.thanks
Destroyer
Destroyer
Forum God
Forum God (41K reputation)Forum God (41K reputation)Forum God (41K reputation)Forum God (41K reputation)Forum God (41K reputation)Forum God (41K reputation)Forum God (41K reputation)Forum God (41K reputation)Forum God (41K reputation)

Group: Forum Members
Posts: 244, Visits: 188
Post your code so we can see how you've coded your connection string.

Destroyer Smooooth
Edited
2/27/2006 by Destroyer
nn
nn
Forum God
Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)Forum God (4.2K reputation)

Group: Forum Members
Posts: 49, Visits: 13
Function OpenDatabase(Username, Password, byref Connection)



   ' Initialise

   OpenDatabase = False

   password="admin"

   Dim DatabaseFilename

   DatabaseFilename = Server.MapPath("/register/db1.mdb")

   Dim ConnectionString

   ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};" &_

    "DBQ=" & DatabaseFilename & ";DefaultDir=;" &_

    "UID=" & Username & ";" &_

    "PWD=" & Password & ";"



   Set Connection = Server.CreateObject("ADODB.Connection")

   Connection.ConnectionTimeout = 30

   Connection.CommandTimeout = 80

   Connection.Open ConnectionString

      

   OpenDatabase = True

      

end Function



this is my code..thanks for reply.Hope you can help thanks a lot
Destroyer
Destroyer
Forum God
Forum God (41K reputation)Forum God (41K reputation)Forum God (41K reputation)Forum God (41K reputation)Forum God (41K reputation)Forum God (41K reputation)Forum God (41K reputation)Forum God (41K reputation)Forum God (41K reputation)

Group: Forum Members
Posts: 244, Visits: 188
Ask your web host what the proper path to your database is. They should be able to help you establish a connection.

Destroyer Smooooth
dannyrose12
dannyrose12
Forum God
Forum God (5.5K reputation)Forum God (5.5K reputation)Forum God (5.5K reputation)Forum God (5.5K reputation)Forum God (5.5K reputation)Forum God (5.5K reputation)Forum God (5.5K reputation)Forum God (5.5K reputation)Forum God (5.5K reputation)

Group: Forum Members
Posts: 13, Visits: 5
why not use the implicit itinerary instead of the congener one you're using now? the "../" is informatory the app to examine in the parent directory of the directory it is currently eating. fair use the complete target.. or see if you can use the tag somewhere (worthless, tho', i bed cipher active asp, but this problem doesn't seem asp unique).


Remote Control Cars | HGH supplements | Dissertation Help
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search