-----Original Message----- >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >Maybe one of you has a trivial example of updating a row >in a VB macro? All the examples I can find are doing it >using a macro EXTERNAL to the database, when the one I'm >using is run from inside the project... did that make sense?
is there any reason you can't use ODBC or OLEDB and just issue an update statement? that would seem the most direct route. this link has an example of the connection string to use for access: http://www.asp101.com/tips/index.asp?id=98 and here's a vbscript example that inserts a bunch of rows. you would want to loop over your flat file reading a line at a time, issuing updates like: sql = "update mytable set fieldx = '" & valuex & "' where" sql = sql & " primarykey = '" & mykey & "'" con.execute(sql) -------------------------------------------------------------------- UID = "system1" PWD = "*******" Service = "marin" Set oAux = CreateObject("Sys1Aux.CAux") Set Con = CreateObject("ADODB.Connection") Set rs = CreateObject("ADODB.RecordSet") Con.Open( "PROVIDER=MSDAORA;DATA SOURCE=" & Service & ";USER ID=" & UID & ";PASSWORD=" & PWD) for i = 1 to 10000 sql="insert into trin_temp values ('" & i & "','" & GUIDGen(oAux) & "')" wscript.echo sql con.execute (sql) next Function GUIDGen(Aux) Dim sGUID sGuid = Aux.GuidGen ' Get rid of the cute curly stuff sGUID = Mid(sGUID, 2, Len(sGUID) - 2) GUIDGen = sGUID End Function ----------------------------------------------------------------------- -- u2-users mailing list [EMAIL PROTECTED] http://www.oliver.com/mailman/listinfo/u2-users
