Jump to content

"connect to..." alert


loui1410
 Share

Recommended Posts

well, first of all, my knowledge in ASP is very superficial. I don't know if the problem I encountered is a problem at all, so I apologise in the first place.we have a school project to build a site containing a few specific points. One of them is to have a registration form, whereas the user clicks the "submit" button, it sends the info to an MDB file. while working on it at school, everything went fine and the table in the MDB file received the info. however, here at home, when I click "submit" a small window appears, requiring username and password, titled "Connect to...". probably some of my PC's configurations are different than the school's. does anybody know what is causing this and how can I solve it?thanks in advance,Louie AW.

Link to comment
Share on other sites

You're probably trying to connect to a database on the other server. You need to find where you are connecting to the database and paste that code here, chances are it is trying to connect to the other server, or you might also have to set up ODBC or something else on your computer, or just use a different connection string. You have IIS installed on your computer at home right?

Link to comment
Share on other sites

Yes I have installed IIS on my computer. The whole project and the files are located in one folder under the wwwroot directory. The path to the wwwroot is the same as it is in school. So I just copied the project the way it is at school and pasted it here, exactly as it is. I've also asked my friend to send me his project, which does work on his PC, but did not work on mine, showing the same window I have mentioned. It says "Connect to aw10-xckzbson9e" (aw10 is my account name).I don't know what ODBC is and I haven't understood what you actually suggested to do. Can you please explain more?Thanks again,Louie.

Link to comment
Share on other sites

ODBC is a way to connect to a database, the acronym stands for Open Database Connectivity. Paste the portion of your code that is connecting to the database, it will look something like this:

set dbcon = Server.CreateObject("ADODB.Connection")

or

set dbcon = Server.CreateObject("ADODB.Recordset")

Paste the several lines of code that come before and after that line. I suspect that you are trying to connect to a database on another server but without seeing the code everything is guessing.

Link to comment
Share on other sites

OK, well there's nothing obviously wrong about that. I assume the MDB file exists, or you would be getting a message saying that instead of a popup box. I'm not sure what's going on off the top of my head, you said the code was running successfully on another computer? Can you post the entire code?

Link to comment
Share on other sites

OK, well there's nothing obviously wrong about that. I assume the MDB file exists, or you would be getting a message saying that instead of a popup box. I'm not sure what's going on off the top of my head, you said the code was running successfully on another computer? Can you post the entire code?
I have just created an ASP file, and wrote inside it <%=date()%>. When I open this file using IE, it's supposed to show today's date, isn't it? I tried to open it using "http://localhost/HarryPotter/date.asp", but the same message appeared, the one requesting username and password! Probably my PC has a problem reaching any ASP file. Does this point out on anything? What is causing this?
Link to comment
Share on other sites

I think it's related to security in IIS, you might not be allowing anonymous access to the web site. Open up IIS and find your site (probably just called Default Site), right-click on it and select Properties. Depending on the version of Windows or IIS you have, check the Directory Security area and make sure that you have Execute permissions, Script permissions, and anonymous access to the site.

Link to comment
Share on other sites

I think it's related to security in IIS, you might not be allowing anonymous access to the web site. Open up IIS and find your site (probably just called Default Site), right-click on it and select Properties. Depending on the version of Windows or IIS you have, check the Directory Security area and make sure that you have Execute permissions, Script permissions, and anonymous access to the site.
I didn't get it how can I open up IIS, I never have. However, if that what you mean, I clicked a right-click on the site directory, and chose the "Web Sharing" tab. There, I clicked "Edit Properties...". Under "Access Permissions", I have "Read" and "Write" checked, while "Script source access" and "Directory browsing" unchecked. This is how it was at school, where it actually worked fine. In that window I also have "Application permissions" where I can chose one of the three options "None", "Scripts" and "Execute (include scripts)"... The second option is chosen.Is everything how it's supposed to be, or it's not what you meant by opening up IIS?Thanks a lot for the immediate help. I really need it.
Link to comment
Share on other sites

For Windows XP:Opening IIS:Open "Control Panel" and double click on "Administrative Tools".Then look for "Internet Information Services", double click.New window will open.Expand "Local Computer" [+] and next expand "[+] Web Sites" In that you will find your folder where asp file is. select that folder [files will list on right] Right click and goto properties of the particular asp file.Goto "File Security" tab and click on "edit" button under "anonymous access......" and do what justsomeguy asked to do...

Link to comment
Share on other sites

Well, the popup box stopped appearing after enabling the "Anonymous access". But now I get the "The page cannot be displayed" page, showing error type:Microsoft OLE DB Provider for ODBC Drivers (0x80004005)[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query./HarryPotter/save.asp, line 32Line 32 is:c.Execute mysqlI read that one of the causes of this error type is that the database would be set to "Rad-only" attribute. However, I checked it and it's not! What could cause this error, then?

Link to comment
Share on other sites

Post your query..... few lines related to forming the sql query.
well, this is the asp file:<%set c=server.createobject("adodb.connection")c.open "driver={microsoft access driver (*.mdb)};dbq=C:\Inetpub\wwwroot\HarryPotter\table.mdb;"dim fi,la,mo,da,ye,em,ad,ci,cou,note,mysqlfi="'" & Request.QueryString("fname") & "'"la="'" & Request.QueryString("lname") & "'"mo="'" & Request.QueryString("month") & "'"da="'" & Request.QueryString("day") & "'"ye="'" & Request.QueryString("yr") & "'"em="'" & Request.QueryString("email") & "'"ge="'" & Request.QueryString("mf") & "'"ad="'" & Request.QueryString("add") & "'"ci="'" & Request.QueryString("city") & "'"cou="'" & Request.QueryString("m_COUNTRY") & "'"note="'" & Request.QueryString("notes") & "'"mysql="insert into fofo(FirstName,LastName,Month,Day,Year,Email,Gender,Address,City,Country,Notes) values(" & fi & "," & la & "," & mo & "," & da & "," & ye & "," & em & "," & ge & "," & ad & "," & ci & "," & cou & "," & note & ")"c.Execute mysql c.closeresponse.write("Your details were successfully delivered!") %>
Link to comment
Share on other sites

Query looks fine, error could be because, one of the field names could be reserved keyword. AFAIK "year" is reserved keyword. to overcome this, you need to give field name within square brackets []Try this qurey,mysql="insert into fofo(FirstName,LastName,Month,Day,[Year],Email,Gender,Address,City,Country,Notes) values(" & fi & "," & la & "," & mo & "," & da & "," & ye & "," & em & "," & ge & "," & ad & "," & ci & "," & cou & "," & note & ")"

Link to comment
Share on other sites

As I had expected, it did not help... I get the same error type. Why would this change anything if it did work at school the first way, without the square-brackets? However, the first general problem pertaining to opening ASP files seemingly has been solved because now the date file (<%=date()%>) does work. So the problem is with one specific file. Any other ideas why do I get this message? (Operation must use an updateable query)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...