Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

database access from ASP

Status
Not open for further replies.

andrey

Programmer
Jun 23, 2000
24
0
0
IL
I can't make neither UPDATE, nor DELETE in DB(MSAccess) using ASP (in other words - any Execute), a simple SELECT only. But if I use VB or VBScript in HTML file - everything is all right. Why?!<br>Thanks.
 
I think....if you want to modify or delete or add any elements in a database you dont use the RecordSet object.<br>Instead you would use the Connection Object<br><br>Therefor you put<br>DataConn.Execute strEditSQL1<br>where your strEditSQL1 is any SQL add/delete/Update SQL<br><br>
 
It's exactly what I do:<br>sSQL=&quot;insert into MyTable values('aaa','bbb','ccc')&quot;<br>cn.Execute sSQL<br><br>It works without problem in VB or VBScript on the same database and table, but the ASP page doesn't load at all!
 
I use recordsets when i am trying to retreive a set of records, I use the command object when I want to make some changes to the database(Delete, Update, Insert, etc) <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
Hi there <br><br>you could use rs.update rs.delete commands insted of sql<br>where rs is a ADODB.recordset <br><br>you have but got to singe out the recordset taht you want to update or delete and then use it <br> <p>Unicorn11<br><a href=mailto:webmaster@tripmedia.com>webmaster@tripmedia.com</a><br><a href= > </a><br>Hi there it all likeminded fellows!!!!!!
 
Front Page 2000 supports database access directly to Microsoft Access and SQL Server 7.<br>But the ISP server has to have Front Page 2000 Extensions on it. <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Try something like this in ASP.<br><br>&lt;%<br>Set conn = Server.CreateObject(&quot;ADODB.Connection&quot;)<br>Conn.Open Session(&quot;ConnectionString&quot;)<br><br>If Request.QueryString(&quot;Delete&quot;) Then<br>sql = &quot;DELETE * FROM Members Where Members.PersonID = &quot; & Request.Form(&quot;PersonID&quot;)<br>Conn.Execute(sql)<br>Response.Redirect &quot;Result.asp?Delete=Success&quot;&nbsp;&nbsp;<br>end if<br>%&gt;<br><br>The global.asa contains the Session(&quot;ConnectionString&quot;).
 
Thank you very much - all!<br>The problem was in file(mdb) permissions. The ASP page is like &quot;guest&quot; for database, so it hasn't needed permission. Since I've changed it - everything is all right.
 
Wow, this thread is a perfect example of what can happen when the question does not contain enough or the essential information describing the problem.<br><br>Good job everyone! Oh, that's not what you were going for was it. hehe ;o)<br><br>andry,<br><br>In future ASP posts consider inclucing the IIS error message, if any, that is returned to the browser. The particular problem you were having is well known and has been discussed several times in this forum in the past two weeks. Most of us would have figured it out from the error message in about two or three seconds.<br><br>&quot;But, that's just my opinion... I could be wrong&quot;.<br>-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top