I
itsyash
I am using the following code to get data into RecSet from my
database. I want to know if there is a way where i can export all
records into a sheet without having to specify fields.
If that is not possible then what's the easiest way to do this?
Sub ExtractRecords()
Dim dbConn As Object
Dim SQLExtract As String
Dim RecSet As New ADODB.Recordset
Set dbConn = CreateObject("ADODB.Connection")
dbConn.Open "Driver={SQL Server};
Server=BALAJI;Database=PNR_Log;Uid=sa; Pwd=sa;"
SQLExtract = "select * from PNRData"
RecSet.Open SQLExtract, dbConn, adOpenDynamic, adLockOptimistic
dbConn.Close
Set dbConn = Nothing
End Sub
Thanks,
Yash
database. I want to know if there is a way where i can export all
records into a sheet without having to specify fields.
If that is not possible then what's the easiest way to do this?
Sub ExtractRecords()
Dim dbConn As Object
Dim SQLExtract As String
Dim RecSet As New ADODB.Recordset
Set dbConn = CreateObject("ADODB.Connection")
dbConn.Open "Driver={SQL Server};
Server=BALAJI;Database=PNR_Log;Uid=sa; Pwd=sa;"
SQLExtract = "select * from PNRData"
RecSet.Open SQLExtract, dbConn, adOpenDynamic, adLockOptimistic
dbConn.Close
Set dbConn = Nothing
End Sub
Thanks,
Yash