Solved

Error on Connecting ISAPI to Access Xp DB

Posted on 2003-11-05
23
380 Views
Last Modified: 2013-11-23
Hi Experts,
I have Two questionS:
Q1-I Defined a DSN in ODBC of Windows 2000 advanced server(system DSN section).I used  database,query,session components For connecting To  My DSN .and when I pressed connected on My object inspector , Connect it,I writed my query and ...
finally compile my ISAPL.dll and worked properly
but when i want to work with submit button  on my web page in my browser, I see this Error:
 "Key violation. [Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot open the file '(unknown)'.It is already opened exclusively by another user, or you need permission to view its data. [Microsoft][ODBC Microsoft Access Driver]Invalid connection string attribute DATABASE General SQL error.
Alias: DELPHILINK"

How can I connect To my database ?

Q2- How can i debug my ISAPI.dll ?
That can be  behave as a process .

Note 1 : My database is Access Xp. I tested this work from my browser.I logged to computer as administrator Role.
Note 2 :
Q1 has 75 points value
Q2 has 50 points  value

best  regards
0
Comment
Question by:Imbeginner
  • 14
  • 9
23 Comments
 
LVL 17

Accepted Solution

by:
geobul earned 125 total points
ID: 9688697
Hi,

About your second question read this: http://community.borland.com/article/0,1410,20901,00.html

Regards, Geo
0
 
LVL 17

Expert Comment

by:geobul
ID: 9688740
About your first question:

Have you set your Session.AutoSessionName to true and assigned that session to your Database.SessionName instead of the Default one?

Regards, Geo
0
 

Author Comment

by:Imbeginner
ID: 9688744
geo,
my Os is windows 2000 advanced server and
has not user manager
0
 
LVL 17

Expert Comment

by:geobul
ID: 9688803
This is in 'Administrative Tools-Local Security Policy'
0
 

Author Comment

by:Imbeginner
ID: 9688839
ok, i m in win98 , i go to my win2000 advanced server
and tell you  result 3 hours later.
0
 

Author Comment

by:Imbeginner
ID: 9688857
I forget on thing:
Thanks a lot of You.
0
 

Author Comment

by:Imbeginner
ID: 9690632
1-
>>Have you set your Session.AutoSessionName to true and assigned that session to your Database.SessionName
 instead of the Default one?<<
yes

2-
I do 1,2,3
but at 4
when i want to stop IIS admin show me the SMTP and NNTP related to IIS admin and i
stopoed these services and set these sevices to manual
5- i did it
6- i did it
7-
At run parameter we have two pages
1-Local
2-Remote
I set on local page
Host application:
C:\WINNT\system32\inetsrv\inetinfo.exe
parameters :
-e w3svc
working directory :
                           <--- blank

click ok

8-I setted breakpoints and I clicked on run button but dont remain on running state
9-I writed in my browser the address of my ISAPI dll
but show me this page:
"The page cannot be displayed|"


I went to internet service manager and i saw that  all of services stopped in this page.

Finally,can you guide me how can i solve theses problems?

regards
0
 

Author Comment

by:Imbeginner
ID: 9692847
Any Feed back From You, GooBul
0
 
LVL 17

Expert Comment

by:geobul
ID: 9694181
Hi,

About 1:
Do you have other Delphi ISAPI application running on the same IIS? If this is the first app then I'd try the IIS without DB first.

1. Create one simple ISAPI with one action only returning a static HTML page on 'GET' request (no databases).
2. Copy the DLL to your scripts folder.
3. Call the link in a browser.

If you get your static HTML page then the IIS is working OK. Try that and let me know the result.

One more thing: the error looks like there is some kind of security/permissions problem. What is your Database.LoginPrompt property set to? Can you use the same DSN with a standalone app (not ISAPI) and when connecting to the db are you receiving a login dialog? You should not see such a dialog.

About 2:
I'm sorry but I can't help you more because I've never had to do so.

Regards, Geo
0
 

Author Comment

by:Imbeginner
ID: 9695662
Hi,
my ISAPI has three actions
the first is restricted to returning back the html page(teturn this page  well ) but when I want to refer to action that have database operations show me above Result page.

about
>> on more thing :<<
i set my database.loginpromt:=false
and i can connect to this DSN with datacontrolls(such as Dbgrid).
0
 
LVL 17

Expert Comment

by:geobul
ID: 9699840
OK, thanks. That makes things clearer. My proposal is to forget about BDE and migrate to ADO using 'Microsoft Jet OLE DB Provider' in the ConnectionString property for accessing mdb databases. You need TADOConnection instead of TDatabase, no TSession, TADOQuery instead of TQuery. If you want to use DSN you might set 'Microsoft OLE DB Provider for ODBC Drivers' in the TADOConnection.

Alternatively you may try CGI instead of ISAPI just to see if it would work as expected.

Regards, Geo
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:Imbeginner
ID: 9706390
Hi,thanks for advice,
but i think my problem was existed in security issue of IIS scripts file,
because when in dicetory security of my anynomouse to administrator my program was
worked. but i dont knoe that i did a good selection for anynomous account.

Finally,what is the best configuring for IIS for connecting to DB ?
0
 

Author Comment

by:Imbeginner
ID: 9706394
on thing :
about debugging ISAPI please refer to this article,
it is sepcial for windows 2000
http://bdn.borland.com/article/0,1410,23024,00.html

with your guideing i can catch it.

best regards



0
 

Author Comment

by:Imbeginner
ID: 9706406
My
11/08/2003 12:51AM PST comment is Full of mistakes(grammer)
sorry
0
 

Author Comment

by:Imbeginner
ID: 9710530
Hi, I changed  BDE to ADO  component  but  My  last problem  was existed ,
I dont know what is the good configurations For my IIS(5)  to supporting my web applications(ISAPI).

Note  1  : My web application want  to interact  with internet Users . <-- important
NOte 2 :  In Future, I want to implement my tables on Oracle Databases
IF you say the answer of below question,I can increase points To 200 with  A grade.
Q:How my web applications(such as ISAPI.dll or CGI ) can connect to oracle database For supporting internet users?
My purpose From upper question is configuring my server side for connecting To db from my web application.
I know, How local users can connect to server side but i dont know how can i configure my web server for
connecting users from my isapi to my DB.

best regards
0
 
LVL 17

Expert Comment

by:geobul
ID: 9713865
Hi,

About configuring your IIS:
Perhaps you should ask a question in another area - 'Web Servers->IIS'.
What I could say is that the anonymous access uses one special account 'IUSR_MachineName' (in my IIS at least). You have to grant that account access to your mdb file. Select the file and open its properties. Go to 'Security' tab and add full access to that account (named 'Internet Guest Account' in my XP).

About Oracle:
There is nothing special about Oracle db compared to other SQL servers, I think. Connect to the sql server as you'd do it in normal apps. The only thing you should check is that your local account (described above) has been granted an appropriate access to the server.

Regards, Geo
0
 

Author Comment

by:Imbeginner
ID: 9716149
About Your IIS Idea:
I read a article in www.maltus.com  about this data entry with ISAPI
>>
Create an ODBC alias for this mdb file called WEBSITE_ODBC using the ODBC Manager.
The ODBC DSN should be a System DSN since it will be used by the Webserver(IIS) and not
by a logged-on user. This point is very important to note. On Windows NT, IIS uses IUSER_ as the user. This user has limited access to the system. <<

what is your idea about this thing ?
0
 
LVL 17

Expert Comment

by:geobul
ID: 9716681
Using ADO you don't need any ODBC DSN. ODBC is the old database access technology while OLE DB Provider (which ADO uses) is the new one. Add TADOConnection component (equvalent of TDatabase), set its ConnectionString property and use TADOQuery, TADOTable, etc ADO components setting their Connection property to that ADOConnection1 (or whatever you name it). Don't forget to grant full access to the mdb file as I said before.
0
 

Author Comment

by:Imbeginner
ID: 9717728
OK,
I often use of ADO ,
but if we attention to article,we can find that
this article say giving  access to tables only special for system (not IUSER_<machinename>).
with your proposed work we give Full permissions to IUSER_<machinename) for accessing to Db,

about :
>>There is nothing special about Oracle db compared to other SQL servers
From BDN :

FAQ663D.txt - InterBase access from a web server application

Category   :Internet/WEB
Platform   :All-32Bit
Product    :

Question:
How can I access Local Interbase from a web server application?

I'm using NT and getting the error message "Unknown user name
or password." when attempting to access Local Interbase from a
Web server application. How do I fix the problem?

Answer:
Make the following changes to your configuration:
1-Interbase must be running as a service (not as an app w/
tray icon).  Which you can change by clicking on the
Properties for the tray icon for IB.
2-Both the Interbase server and WWW Server must have the
following right set: Control Panel | Services |
InterBase Server | Startup make sure "Allow Service to
Interact with Desktop is checked". <--- my purpose is this

Regards


0
 

Author Comment

by:Imbeginner
ID: 9730782

Geobul
thanks for your assisting
but you can give only 50 points with A grade of total points.
0
 
LVL 17

Expert Comment

by:geobul
ID: 9731541
At this moment I have several ISAPI and CGI apps (IIS) working perfectly with mdb files via ADO (MS Jet OLE DB) in the way I've already described. I also have one ISAPI using System DSN ODBC (MS Access Driver) but with MSAccess97 database. I don't know what else I could say.

If you want to give me 50 points then ask a question (for zero points) in the Community Support (CS link at the top of the page) to decrease the points of this question and to refund you the rest. Add a link to this question there also.
0
 

Author Comment

by:Imbeginner
ID: 9738406
Geobul,
Sorry For everything,
Becasue the experts effort in this site are for helping others.
But i compared your effort with points,
also,you are a best man in delphi related work.
I will give you all of points(125 with A grade)

about:
>>I also have one ISAPI using System DSN ODBC (MS Access Driver) but with MSAccess97
database. I don't know what else I could say<<
Do you define IUSER_<machinename> user  in properties/security for your mdb file ?
IF yes,in really your IUSER_<macinename> uses for Writing/Reading  To/From your DB(not system user)
IF No, I will intall access( 2000 or  97) For this work .

Regards
0
 
LVL 17

Expert Comment

by:geobul
ID: 9739798
Hi,

>Sorry For everything,
There is nothing you have to sorry for.

>you are a best man in delphi related work.
Thank you.

>I will give you all of points(125 with A grade)
You don't have to. Just ask a question in CS and site moderators will handle the issue. They are always very helpful.

>Do you define IUSER_<machinename> user  in properties/security for your mdb file ?
Yes. You could try both ways yourself and see if there will be any difference.

>IF yes,in really your IUSER_<macinename> uses for Writing/Reading  To/From your DB(not system user)
I really don't know :-)

Regards, Geo
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

705 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

13 Experts available now in Live!

Get 1:1 Help Now