Click here to Skip to main content
15,917,563 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Ngen fail with a protected .net exe file Pin
dilkonika9-Jun-14 6:07
dilkonika9-Jun-14 6:07 
GeneralRe: Ngen fail with a protected .net exe file Pin
Richard Deeming9-Jun-14 6:12
mveRichard Deeming9-Jun-14 6:12 
QuestionDisable/Hide menu items based on user's right? Pin
savedlema9-Jun-14 3:35
savedlema9-Jun-14 3:35 
AnswerRe: Disable/Hide menu items based on user's right? Pin
Eddy Vluggen9-Jun-14 4:24
professionalEddy Vluggen9-Jun-14 4:24 
GeneralRe: Disable/Hide menu items based on user's right? Pin
savedlema9-Jun-14 9:12
savedlema9-Jun-14 9:12 
GeneralRe: Disable/Hide menu items based on user's right? Pin
Eddy Vluggen10-Jun-14 5:26
professionalEddy Vluggen10-Jun-14 5:26 
QuestionProblems running the application on another computer Pin
dilkonika8-Jun-14 5:52
dilkonika8-Jun-14 5:52 
AnswerRe: Problems running the application on another computer Pin
Richard MacCutchan8-Jun-14 6:38
mveRichard MacCutchan8-Jun-14 6:38 
GeneralRe: Problems running the application on another computer Pin
dilkonika8-Jun-14 8:52
dilkonika8-Jun-14 8:52 
GeneralRe: Problems running the application on another computer Pin
dilkonika8-Jun-14 10:47
dilkonika8-Jun-14 10:47 
GeneralRe: Problems running the application on another computer Pin
Richard MacCutchan8-Jun-14 21:49
mveRichard MacCutchan8-Jun-14 21:49 
QuestionCopy Table from Word then Paste to Excel VB.net Pin
_XeLo_5-Jun-14 23:29
_XeLo_5-Jun-14 23:29 
AnswerRe: Copy Table from Word then Paste to Excel VB.net Pin
Chris Quinn6-Jun-14 0:22
Chris Quinn6-Jun-14 0:22 
GeneralRe: Copy Table from Word then Paste to Excel VB.net Pin
_XeLo_6-Jun-14 14:40
_XeLo_6-Jun-14 14:40 
Questioncopy to next available row Pin
David Rubin4-Jun-14 5:10
David Rubin4-Jun-14 5:10 
QuestionNeed Help to connect to MQ 7.0 using user id getting 2035 error. Pin
Member 102184182-Jun-14 21:03
Member 102184182-Jun-14 21:03 
QuestionUsing Functions across forms Pin
gwittlock1-Jun-14 16:34
gwittlock1-Jun-14 16:34 
AnswerRe: Using Functions across forms Pin
Peter Leow1-Jun-14 17:12
professionalPeter Leow1-Jun-14 17:12 
GeneralRe: Using Functions across forms Pin
gwittlock1-Jun-14 18:14
gwittlock1-Jun-14 18:14 
AnswerRe: Using Functions across forms Pin
Bernhard Hiller2-Jun-14 0:23
Bernhard Hiller2-Jun-14 0:23 
GeneralRe: Using Functions across forms Pin
gwittlock2-Jun-14 1:14
gwittlock2-Jun-14 1:14 
Questionlistview won't display data populated in vb6 Pin
Dave-1016953130-May-14 6:37
professionalDave-1016953130-May-14 6:37 
AnswerRe: listview won't display data populated in vb6 Pin
Tim Carmichael30-May-14 9:02
Tim Carmichael30-May-14 9:02 
GeneralRe: listview won't display data populated in vb6 Pin
Dave-1016953130-May-14 9:32
professionalDave-1016953130-May-14 9:32 
QuestionImport from SQL table by column Pin
Member 1066669830-May-14 4:38
Member 1066669830-May-14 4:38 
Hi everyone

I have the following to extract data from a SQL database and write it to an Excel table. I would likte to change the loop so that the data is copied to Excel per column rather than single field (to speed up th import):

'Create the connection string
sConnString = "Provider=SQLOLEDB.1;Data Source=SRV002982;" & _
              "Initial Catalog=HFMDSmartFDM_QMR211;" & _
              "Password=password;Persist Security Info=True;User ID=User"

'Create the Connection and Recordset objects
Set conn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")

'Open the connection and execute
conn.Open sConnString
Set rs = conn.Execute(CommandString)

    'Check data
    If Not rs.EOF Then
        nRow = nRow + 1
        'Transfer result to WS
        Do While Not rs.EOF
            For Each elem In rs.Fields
                nCol = nCol + 1
                ws.Cells(nRow, nCol) = elem
            Next
        rs.movenext
        Loop
    End If


There are reasons I can't just splash the entire table. I need to import column by column. Any help is greatly appreciated

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.