Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: call to update a recordset within a script--data access pages


Message #1 by "Sonia Carlson" <soniac@u...> on Fri, 6 Apr 2001 02:15:58
Hello:



I have added a script to an onclick event which generates some values.  I 

want to create a new record for each value and save the value to a field 

in the table.  How can I do this?  Do I need to use an MSODSC event(s)? If 

so, how? Any help would be greatly appreciated.  This has been a thorn in 

my side for a while.

Thanks

Sonia
Message #2 by "Pardee, Roy E" <roy.e.pardee@l...> on Fri, 06 Apr 2001 07:45:37 -0700
You can use DoCmd.RunSQL to run "INSERT INTO " statements, or define a

recordset & make calls to its .AddNew and .Update.



HTH,



-Roy



-----Original Message-----

From: Sonia Carlson [mailto:soniac@u...]

Sent: Thursday, April 05, 2001 7:15 PM

To: Access

Subject: [access] call to update a recordset within a script--data

access pages





Hello:



I have added a script to an onclick event which generates some values.  I 

want to create a new record for each value and save the value to a field 

in the table.  How can I do this?  Do I need to use an MSODSC event(s)? If 

so, how? Any help would be greatly appreciated.  This has been a thorn in 

my side for a while.

Thanks

Sonia



Message #3 by "Sonia Carlson" <soniac@u...> on Mon, 9 Apr 2001 19:43:51
Hello Roy:

Thanks for your response.  I'm having trouble with this...I can't seem to 

establish a connection from the script.  The DAPs were created in the 

current database, so they are connected by default.  However, I can't 

access the database from within the VBscript.  I have tried opening the 

dbase with a UNC address and then using standard ADO code to connect.  I'm 

using Win98 personal web server.  Perhaps you have some insight into this?



Thanks

Sonia 







>You can use DoCmd.RunSQL to run "INSERT INTO " statements, or define a

> recordset & make calls to its .AddNew and .Update.

> 

> HTH,

> 

> -Roy

> 

> -----Original Message-----

> From: Sonia Carlson [mailto:soniac@u...]

> Sent: Thursday, April 05, 2001 7:15 PM

> To: Access

> Subject: [access] call to update a recordset within a script--data

> access pages

> 

> 

> Hello:

> 

> I have added a script to an onclick event which generates some values.  

I 

> want to create a new record for each value and save the value to a field 

> in the table.  How can I do this?  Do I need to use an MSODSC event(s)? 

If 

> so, how? Any help would be greatly appreciated.  This has been a thorn 

in 

> my side for a while.

> Thanks

> Sonia

> 

Message #4 by "Pardee, Roy E" <roy.e.pardee@l...> on Mon, 09 Apr 2001 14:01:37 -0700
Yeesh--I'm afraid that's out of my depth.  I've been lucky enough to avoid

the black arts of web programming 8^).



I have done a little bit of database access from VBScript tho--here's a

snippet that's working here...



'=======================================================

Dim conn

Dim Network

Dim strSQLInsert

   

   Set conn = WScript.CreateObject("ADODB.Connection")

   Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " _

            & "Data

Source=\\zeus-cw\lm_apps\SharedAccessFunctions\MDIGroups.mdb;" _

            & "Persist Security Info=False"



   Set Network = WScript.CreateObject("WScript.Network")

   

   strSQLInsert = "INSERT INTO tblTest (ComputerName, UserName) " _

      & vbNewLine & "VALUES (""" & Network.ComputerName & """, """ &

Network.UserName & """) ;"

   

   MsgBox strSQLInsert

   

   conn.Execute strSQLInsert

   

   Conn.Close

   

   Set Conn = Nothing

   Set Network = Nothing

   

   MsgBox "Done"



'=======================================================

-----Original Message-----

From: Sonia Carlson [mailto:soniac@u...]

Sent: Monday, April 09, 2001 12:43 PM

To: Access

Subject: [access] RE: call to update a recordset within a script--data

acc ess pages





Hello Roy:

Thanks for your response.  I'm having trouble with this...I can't seem to 

establish a connection from the script.  The DAPs were created in the 

current database, so they are connected by default.  However, I can't 

access the database from within the VBscript.  I have tried opening the 

dbase with a UNC address and then using standard ADO code to connect.  I'm 

using Win98 personal web server.  Perhaps you have some insight into this?



Thanks

Sonia 







>You can use DoCmd.RunSQL to run "INSERT INTO " statements, or define a

> recordset & make calls to its .AddNew and .Update.

> 

> HTH,

> 

> -Roy

> 

> -----Original Message-----

> From: Sonia Carlson [mailto:soniac@u...]

> Sent: Thursday, April 05, 2001 7:15 PM

> To: Access

> Subject: [access] call to update a recordset within a script--data

> access pages

> 

> 

> Hello:

> 

> I have added a script to an onclick event which generates some values.  

I 

> want to create a new record for each value and save the value to a field 

> in the table.  How can I do this?  Do I need to use an MSODSC event(s)? 

If 

> so, how? Any help would be greatly appreciated.  This has been a thorn 

in 

> my side for a while.

> Thanks

> Sonia

> 

Message #5 by "Sonia Carlson" <soniac@u...> on Wed, 11 Apr 2001 00:31:20
Oh well.  I will try the W.script.  The rest of the code looks standard, 

so maybe its just a personal web server issue (not surprising).

Thanks!

Sonia

> 



Yeesh--I'm afraid that's out of my depth.  I've been lucky enough to avoid

> the black arts of web programming 8^).

> 

> I have done a little bit of database access from VBScript tho--here's a

> snippet that's working here...

> 

> '=======================================================

> Dim conn

> Dim Network

> Dim strSQLInsert

>    

>    Set conn = WScript.CreateObject("ADODB.Connection")

>    Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " _

>             & "Data

> Source=\\zeus-cw\lm_apps\SharedAccessFunctions\MDIGroups.mdb;" _

>             & "Persist Security Info=False"

> 

>    Set Network = WScript.CreateObject("WScript.Network")

>    

>    strSQLInsert = "INSERT INTO tblTest (ComputerName, UserName) " _

>       & vbNewLine & "VALUES (""" & Network.ComputerName & """, """ &

> Network.UserName & """) ;"

>    

>    MsgBox strSQLInsert

>    

>    conn.Execute strSQLInsert

>    

>    Conn.Close

>    

>    Set Conn = Nothing

>    Set Network = Nothing

>    

>    MsgBox "Done"

> 

> '=======================================================

> -----Original Message-----

> From: Sonia Carlson [mailto:soniac@u...]

> Sent: Monday, April 09, 2001 12:43 PM

> To: Access

> Subject: [access] RE: call to update a recordset within a script--data

> acc ess pages

> 

> 

> Hello Roy:

> Thanks for your response.  I'm having trouble with this...I can't seem 

to 

> establish a connection from the script.  The DAPs were created in the 

> current database, so they are connected by default.  However, I can't 

> access the database from within the VBscript.  I have tried opening the 

> dbase with a UNC address and then using standard ADO code to connect.  

I'm 

> using Win98 personal web server.  Perhaps you have some insight into 

this?

> 

> Thanks

> Sonia 

> 

> 

> 

> >You can use DoCmd.RunSQL to run "INSERT INTO " statements, or define a

> > recordset & make calls to its .AddNew and .Update.

> > 

> > HTH,

> > 

> > -Roy

> > 

> > -----Original Message-----

> > From: Sonia Carlson [mailto:soniac@u...]

> > Sent: Thursday, April 05, 2001 7:15 PM

> > To: Access

> > Subject: [access] call to update a recordset within a script--data

> > access pages

> > 

> > 

> > Hello:

> > 

> > I have added a script to an onclick event which generates some 

values.  

> I 

> > want to create a new record for each value and save the value to a 

field 

> > in the table.  How can I do this?  Do I need to use an MSODSC event

(s)? 

> If 

> > so, how? Any help would be greatly appreciated.  This has been a thorn 

> in 

> > my side for a while.

> > Thanks

> > Sonia

> > 


  Return to Index