Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


my code sample

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,31415
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> my code sample
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 my code sample - 2/22/2006 2:57:34 AM   
  maich

 

Posts: 4
Score: 0
Joined: 2/15/2006
Status: offline
The error that i get is
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
/CHAK/sites/admin/addmember.asp, line 19

<!--#Include file="../../connections/connChak.asp"-->
<%
'on error resume Next
dim inRS,strsql3,strData,CID,MTID,TC
CID=request.Form("CHURCHID")
MTID=request.Form("MEMBERTYPEID")
IF request.Form("MEMBERTYPEID")=1 THEN
TC="Y"
ELSE
TC="N"
END IF
strsql3="INSERT INTO MEMBERS(MEMBERNAME,ADDRESS,CITY,CHURCHID,TELEFAX,DISTRICT,REGION,MEMBERTYPEID,TRAININGCENTRE)"
strsql3=strsql3 & " VALUES('" & fixQuotes(request.Form("MEMBERNAME")) & "','" & fixQuotes(request.Form("ADDRESS")) & "','" & _
fixQuotes(request.Form("CITY"))& "','" & CINT(CID) & "','" & fixQuotes(request.Form("TELEFAX")) & "','" & fixQuotes(request.Form("DISTRICT"))& "','" & _
fixQuotes(request.Form("REGION"))& "','" & CINT(MTID)& "','" & TC & "')"

conn.execute strsql3

Function fixQuotes(strData)
fixQuotes=Replace(strData,"'","''")
End function
%>

the conn looks like this
<% dim conn
'strConnect="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\chak2\data\dbchak.mdb"
set conn=server.CreateObject("ADODB.CONNECTION")
set rst=server.CreateObject("ADODB.RECORDSET")
conn.open "DSN=chakDB;UID=;Password=;"
'conn.Open strConnect
%>

the database is Microsoft access 2003
 
 
Post #: 1
 
 RE: my code sample - 2/22/2006 3:10:21 AM   
  ebgreen


Posts: 5069
Score: 31
Joined: 7/12/2005
Status: online
If you write out the value of strSQL3 just before you try to execute it, what does it look like?

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to maich)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> my code sample Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts