For Standard Security (from
http://www.carlprothman.net/Default.aspx?tabid=87#OLEDBProviderForSQLServer)
oConn.Open "Provider=sqloledb;" & _
"Data Source=myServerName;" & _
"Initial Catalog=myDatabaseName;" & _
"User Id=myUsername;" & _
"Password=myPassword"
oroConn.Open "Provider=sqloledb;" & _
"Server=myServerName;" & _
"Database=myDatabaseName;" & _
"User Id=myUsername;" & _
"Password=myPassword"
BecomesoConn.Open "Provider=sqloledb;" & _
"Data Source=Mobile29;" & _
"Initial Catalog=StockQuote ;" & _
"User Id=myUsername;" & _
"Password=myPassword"Sub UpdateSQL()Dim conn As
ADODB.ConnectionDim rst as ADODB.RecordsetDim i as Integerdb =
WorkbookNameHere.Path (here is a sticking spot - is there more to put
here?)Set conn = New ADODB.ConnectionSet rec = New ADODB.ConnectionConn.Open
"Provider=sqloledb;" & _
"Data Source=Mobile29;" & _
"Initial Catalog=StockQuote ;" & _
"User Id=myUsername;" & _
"Password=myPassword"strSQL = "SELECT * FROM
tbl_StockQuote"rec.open strSQL , conn, adOpenForwardOnly, adLockReadOnly
For i - 0 To rst.Fields.Count - 1 Range("A1").Offset(0,i).Value =
rst.Fields(i).Name NextIf rec.EOF = False Then rng.Offset(37,
0).CopyFromRecordset recEnd If Range("A1").Offset(1,0).CopyFromRecordset
rstEnd WithSet rst = Nothingconn.CloseSet conn = NothingEnd SubUNTESTED,
but should bring you in the correct direction
regards
JY
> The whole connection would be something like;
> Data Source = Mobile29
[quoted text clipped - 97 lines]
>> >
>> > ... John
JohnE - 31 Jan 2008 21:12 GMT
Well, I tried working with this but nothing goes. I am at a loss on
what/where to go from here. I guess my newbie-ness is really showing thru on
this.
Can anyone see what is wrong as to why this is not getting to the db on sql
server?
Thanks.
... John
> For Standard Security (from
> http://www.carlprothman.net/Default.aspx?tabid=87#OLEDBProviderForSQLServer)
[quoted text clipped - 133 lines]
> >> >
> >> > ... John