Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asptoday_discuss thread: Updation Error


Message #1 by "Kalpesh Bhatt" <k_b_bhatt@h...> on Tue, 22 Jan 2002 08:36:06
I am not able to update my access database. Please check my code. It is 

working correctly on PWS.

<%

dim strCon

 strCon = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath

("data")  & "\master.mdb" 



Dim StrSql1

Set Cn1 = Server.CreateObject( "ADODB.Connection" )

Set Rs1 = Server.CreateObject( "ADODB.Recordset" )

Cn1.open strCon



LID = Request.Form("LID")

LT = Request.Form("LText1")



StrSql1 = "Select * From LinkText"

Rs1.Open StrSql1,Cn1,1,3

StrSql1 = "LinkID=" & LID

Rs1.Filter = StrSql1



If Not Rs1.EOF AND Not Rs1.BOF Then

    Rs1( "TextOnLink" ) = Trim(LT)

    Rs1.Update

End if

Rs1.close

Set Rs1 = nothing

Cn1.Close

Set Cn1 = nothing

%>
Message #2 by "Dmitry Zakharov" <brook74@h...> on Tue, 29 Jan 2002 11:34:04
What's the problem ? I coudn't get ... Try not to use Server before 

CreateObject. In that case U will use not server but default application 

object.



Cheers.





> I am not able to update my access database. Please check my code. It is 

> working correctly on PWS.

> <%

> dim strCon

>  strCon = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & 

server.MapPath

> ("data")  & "\master.mdb" 

> 

> Dim StrSql1

> Set Cn1 = Server.CreateObject( "ADODB.Connection" )

> Set Rs1 = Server.CreateObject( "ADODB.Recordset" )

> Cn1.open strCon

> 

> LID = Request.Form("LID")

> LT = Request.Form("LText1")

> 

> StrSql1 = "Select * From LinkText"

> Rs1.Open StrSql1,Cn1,1,3

> StrSql1 = "LinkID=" & LID

> Rs1.Filter = StrSql1

> 

> If Not Rs1.EOF AND Not Rs1.BOF Then

>     Rs1( "TextOnLink" ) = Trim(LT)

>     Rs1.Update

> End if

> Rs1.close

> Set Rs1 = nothing

> Cn1.Close

> Set Cn1 = nothing

> %>

  Return to Index