Solved

dsn-less connection

Posted on 2002-05-26
20
146 Views
Last Modified: 2010-05-02
Hi , can anyone tell me the connection string to open Access database located in a site in the internet using the following data using VB6:

databse name :  mmm.mdb
user name :  ""
password : ""

the database file located in the folder
http://test1.brink.com/ashraf

these information is not true but as an example

Thanx
0
Comment
Question by:ashraf_t
  • 10
  • 9
20 Comments
 
LVL 33

Expert Comment

by:hongjun
Comment Utility
>>to open Access database located in a site in the internet
Are they in the same web server as your asp file?

DSNLess Connection for Access
http://www.able-consulting.com/ADO_Conn.htm#ODBCDriverForAccess


hongjun
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
you already asked this question (http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20303647) and there was no answer to it. Access alone cannot do it. You need a something like a WebService or DCOM to do it. Or move to SQL server.
0
 

Author Comment

by:ashraf_t
Comment Utility
for hongiun , what is the asp file ??

for emoreau , u can go to the site www.brinkster.com , it is possoble to open access database file
0
 

Author Comment

by:ashraf_t
Comment Utility
for hongiun again, i saw the site u send but i noticed that the example open a database file from the hard disk C , i want to open it from a web site ?!
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
>>for emoreau , u can go to the site www.brinkster.com , it is possoble to open access database file

Yes you can use Brinkster to store your MDB file but you will not be able to have a VB application run on a client PC opening an Access database on Brinkster.
0
 

Author Comment

by:ashraf_t
Comment Utility
for emoreau : u can read there and u will see that they r talking about connection to the access db
they r using this example:
DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" server.MapPath ("username\db\mmm.mdb")
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
>> server.MapPath

SERVER is an object that you can use in VBScript. I have contacted Brinkster support about a month ago to know it were possible to connect to an Access database using a regular VB6 app and they told me that it can be done. Access to the database must be done server-sided.
0
 

Author Comment

by:ashraf_t
Comment Utility
so they told u it can be done ! , so how can i make it as u said ?
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
If you can do VB.Net, use create a WebService that will return a recordset.

If you do VB6, you will need to use DCOM and I don't know if they support it.

After there answer, I stopped my project.
0
 

Author Comment

by:ashraf_t
Comment Utility
Anyway , can u tell me about a site which describe how to use VBscript with good examples , Thanx
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
0
 

Author Comment

by:ashraf_t
Comment Utility
nice examples but do u know why iam always recieving an error saying that object Server not found

ps: iam using the frontpage 2000 to write the code , is this right?
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
server is an object that must run in VBScript on a IIS server.
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
load the sample to your brinkster account to test it.
0
 

Author Comment

by:ashraf_t
Comment Utility
if u mean to the site , yes i did that but same error message
0
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 50 total points
Comment Utility
upload a copy of nwind.mdb database to your brinkster db folder and copy this to a file called default.asp into your brinkster account:

<%
Option Explicit
Response.Expires = -1000

Dim oConn
Dim oRS
Dim sSQL
Dim sColor

Response.Write("<font size=2 face=arial>")
Response.Write("Brinkster Example #1<br>")
Response.Write("Database Select Example Using Microsoft's Northwind Sample Database<br><br>")

Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\YourAccountNameGoesHere\db\nwind.mdb"))

sSQL = "SELECT ProductName, QuantityPerUnit, UnitPrice, UnitsInStock FROM Products"
Set oRS = oConn.Execute(sSQL)

    Response.Write("<table border=1 cellpadding=1 cellspacing=1 style='font-family:arial; font-size:10pt;'>")
    Response.Write("<tr bgcolor=black style='color:white;'><td>Product Name</td>")
    Response.Write("<td>Quantity Per Unit</td>")
    Response.Write("<td align=right>Price</td>")
    Response.Write("<td>In Stock</td></tr>")

sColor = "white"

Do While NOT oRS.EOF

    If sColor = "silver" Then
         sColor = "white"
    Else
         sColor = "silver"
    End If
 
    Response.Write("<tr bgcolor='" & sColor & "'>")
    Response.Write("<td>" & oRS("ProductName").Value & "</td>")
    Response.Write("<td>" & oRS("QuantityPerUnit").Value & "</td>")
    Response.Write("<td align=right>$" & oRS("UnitPrice").Value & "</td>")
    Response.Write("<td align=right>" & oRS("UnitsInStock").Value & "</td></tr>")
   
    oRS.MoveNext

Loop

    Response.Write("</table><br><br>")

oConn.Close
Set oRS = Nothing
Set oConn = Nothing

%>
0
 

Author Comment

by:ashraf_t
Comment Utility
what part of the asp page i will put this code ?
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
Use this script as your complete page first and run it. Once you have it working, start adding what you want.

I just thought of your FrontPage document: is the extension is .ASP? It has to be .ASP because you need scripts to be runned at the server!
0
 
LVL 69

Expert Comment

by:Éric Moreau
Comment Utility
any progress?
0
 

Author Comment

by:ashraf_t
Comment Utility
Thanx for ur help
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now