New to VBScript
-
I am new to VBScript and i have a problem in getting the application path to set the database path(like app.path) Data Source=C:\WINDOWS\Desktop\DataBase\collection.mdb; Persist Security Info=False" Here instead of giving the whole path how can i get the path???:confused:
-
I am new to VBScript and i have a problem in getting the application path to set the database path(like app.path) Data Source=C:\WINDOWS\Desktop\DataBase\collection.mdb; Persist Security Info=False" Here instead of giving the whole path how can i get the path???:confused:
Server.MapPath(_RelativePath_)
will give the absolute physical path of a relative path (relative to the current ASP page) -
Server.MapPath(_RelativePath_)
will give the absolute physical path of a relative path (relative to the current ASP page) -
Thanks will it work with VBScript? And will you suggest VBScript for databases??? Are there any disadvantages with VBScript
It will work if this is an ASP page. If you're trying this by running a .vbs file from your desktop it won't because you're using WSH. Again if you're running Server-Side Web pages (I'm assuming this since this is the ASP, ASP.NET forum) VBScript is about the easiest way to go. If this is a desktop app you'll get better performance running full VB. Of course if possible I'd recommend using .NET.
-
It will work if this is an ASP page. If you're trying this by running a .vbs file from your desktop it won't because you're using WSH. Again if you're running Server-Side Web pages (I'm assuming this since this is the ASP, ASP.NET forum) VBScript is about the easiest way to go. If this is a desktop app you'll get better performance running full VB. Of course if possible I'd recommend using .NET.
-
i have a doubt, i mean can i use VBscript(without ASP) for client side scripting keeping the database on the server I mean can i access the database on the server from a client machine by VBScript alone on an HTML page
Sure you could do it. There are limitations, though. For one thing ADO objects are unsafe so the user will have to lower their Internet Security. Also you'll have to make sure that the user has an adequate MDAC installed. Also there are no objects like
Server
available to resolve your names. If you're using Access, you have to use physical file paths. (Either Map a drive or use UNC (\\) notation) as it needs Read/Write file permissions to work (and doesn't work over WebDav like other office programs will). Lastly the network connections ADO makes won't run over most firewalls. So if you're dealing with a local Intranet Scenario where you have tight control over the client the answer is yes. If not the answer is a practical no. (Its possible, but way too much work to be worth it).