|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#16
|
|||
|
|||
|
Ok So I tried what you suggested.
I replaced the following INSERT Query sSQL = "INSERT into users_tbl (name, email, comments) values ('" & _ name & "', '" & email & "', '" & comments & "')" to THIS select Query sSQL = "SELECT * FROM users_tbl" (Just selecting, no other command) And I got a fine result... which probably means that my insert code is wrong? or what... :X becuase I checked well and the code seems just fine ehhh |
|
#17
|
||||
|
||||
|
Well, the process of debugging involves small, incremental steps to isolate the problem. You now know that (1) your web server can find your source file; (2) your web server is interpreting your asp code; (3) your web server is communicating with your database. I'd say that's a pretty good start, since you were asking essentially those questions, before. Now, let's go back and see what the remaining issue is. Is it an error message that complains about your query? That tells me that something is wrong with either the query or the data. So I'd check to see that all the variables in your query contain the values you think they are, and if that's true, then look at the syntax (which I think you have already done), and finally at whether what you're asking it to do makes sense, logically. Usually that "non-updateable" error is given when your query attempts to update a record, or records, that Access is unable to determine which record(s) to update. In your case, it's an Insert query, so all I can think of is that either it can't find the table, or the table is somehow locked (permissions) or something like that.
__________________
Experience is the thing you have left when everything else is gone. |
|
#18
|
|||
|
|||
|
No idea. ehh.
The file is READY for archiving, I didn't do anything to unauthorize and it does SELECT the columns. I checked maybe the vaules were wrong or name of table / mdb but not.. everything seems just fine and yet I can't figure what is wrong, why can't i insert information to my table. Everything seems ok with the code Everything seems ok with the permission Everything seems ok with the data I insert. So. what the hell? Looking forward for help Thanks In advance! |
|
#19
|
||||
|
||||
|
I went back and looked at your original question. This is an ASP/web application. Hmmm. Have you previously been able to successfully insert new records to that table or database? If you have, possibly your database file has been corrupted, you might try a Compact & Repair operation on it. If this is your first attempt to write to this database, all I can think of is a possible configuration issue in your web server that allows your ASP to read from, but not write to your database.
I guess the next thing I would do is write a short test script to insert one record into that table, using the same connection string and just fill a couple of fields, to see whether your system is not allowing ANY inserts. I hope someone else with more ASP experience will offer some suggestions. Last edited by don94403 : June 28th, 2009 at 01:57 PM. |
|
#20
|
|||
|
|||
|
Quote:
Isn't it what i've just done? with the command? I don't understand you, please give me the exact command you mean I can write data into the table using the DB itself. And It's not corrupt becuase I tried connecting the ASP to another database. |
|
#21
|
||||
|
||||
|
Quote:
No. Read what I wrote again. "write a short test script" doesn't mean sending a command from the command line or using Access directly. It means write an ASP script, which goes through a completely different process, which seems to be where the problem is. You have already eliminated the possibilities that the problem lies with the database itself. Quote:
I agree. So now you have to concentrate on what else in your process could be causing the error. That seems to leave the interface between the web server and ASP and your database. That's why you have to write an ASP script (a simple one, probably not more than 4 or 5 lines of code). I'm not going to be able to be of much more help to you. I've written many hundreds of Access applications and many dozens of PHP/MySQL applications, but only one ASP/Access application. |
|
#22
|
|||
|
|||
|
Quote:
Still having problems with the issue. It's a simple SQL command after all I'm sure some1 does know the solution Please help, thanks in advance! |
|
#23
|
||||
|
||||
|
--> Moved to ASP Forum
I had a quick read of the thread but I'mnot sure what happened when you ran the test suggested by Don. What happens if you create a new .asp page in your folder then view it in the browser: Code:
<html>
<head>
<title>SQL Test</title>
</head>
<body>
<%
sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("Users.mdb")
Set cn = Server.CreateObject("ADODB.Connection")
cn.Open(sConnString)
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "select * FROM users_tbl"
Set rs = cn.Execute(sql)
Response.Write("<table><tr>")
For Each x In rs.Fields
Response.Write("<td>" & x.Name & "</td>")
Next
Response.Write("</tr>")
While NOT rs.EOF
Response.Write("<tr>")
For Each x In rs.Fields
Response.Write("<td>" & x.Value & "</td>")
Next
Response.Write("</tr>")
rs.MoveNext
Wend
Response.Write("</table>")
rs.Close
cn.Close
Set cn = Nothing
%>
</body>
|
|
#24
|
|||
|
|||
|
Quote:
Sorry I dont understand. Do you want me to create this ASP file without connecting it to any other page / form of my current files ? And the code, did you already edit it according to my table and frields or should I fill the "x" with other values? Thanks . |
|
#25
|
|||
|
|||
|
Ughh
Stil looking for some help!Thanks in advance. |
|
#26
|
||||
|
||||
|
as sos i did not go through the multiple posts thoroughly...what stuck out was a .asp page displaying the code versus executing...
i do believe don went through w/ you as far as 'where' these files should reside...if you are still seeing code then i'd have to guess you do not have these files on the web server... also, as don mentioned a test script is needed...are you able to execute asp code at all? for example if you save a file called test.asp on the web server and open it up via iis test.asp Code:
<%=time%> should display the current time on your computer ...and not to overlook the obvious 1. what operating system are you running? xp pro/home edition/vista/linux/etc/ 2. are you using microsoft Internet Information Server (IIS) and is it installed (from the cd)? control panel/add or remove windows components/(iis is checked) as sos mentioned i too do not see where/if you debugged an asp page <edit> i read a little more...this is a common error and there is a 'sticky' in this forum that will help you resolve the not updateable problem: http://forums.aspfree.com/asp-devel...uide-96087.html also...a wealth of information is on google searches..it's highly suggested to search for the key words and/or error description you are getting...you probably would have found the fix long ago w/ a little effort versus relying on volunteer support
__________________
Please give respect to those that helped solve an issue by clicking on the reputation icon
Last edited by keep_it_simple : July 9th, 2009 at 01:53 AM. |
|
#27
|
||||
|
||||
|
Quote:
Yes, its a simple command, so I would guess there is a problem with the data being submitted, or the field type. Quote:
In your ASP you should have something like: _name = Request.Form("_name") <--- is this field actually called _name and not name? email = Request.Form("email") comments=Request.Form("comments") ....then your insert and then the connection and execute bits. Are the fields in the users_tbl all just plain TEXT fields? Put - Response.Write(sSQL) ... into your ASP page and comment out the connect/execute bits. Does the INSERT statement and the data in it look 100%? What exactly happens when you use the INSERT code? I would post the error that you are getting:- Sorry if I'm on the wrong track, it just seems that the issue is the data from what I have read. |
![]() |
| Viewing: ASP Free Forums > Programming > ASP Development > Problem with inserting data to ms access databse |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|