Click here to Skip to main content
15,911,711 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionProblem receiving hex value on serialport Pin
Member 102013576-Nov-20 3:23
Member 102013576-Nov-20 3:23 
QuestionDim objNewItem As ComboItem Pin
empalamado4-Nov-20 7:00
empalamado4-Nov-20 7:00 
AnswerRe: Dim objNewItem As ComboItem Pin
Victor Nijegorodov4-Nov-20 7:51
Victor Nijegorodov4-Nov-20 7:51 
AnswerRe: Dim objNewItem As ComboItem Pin
Dave Kreskowiak4-Nov-20 8:39
mveDave Kreskowiak4-Nov-20 8:39 
QuestionNaming added Controls Pin
Member 1495490329-Oct-20 12:00
Member 1495490329-Oct-20 12:00 
AnswerRe: Naming added Controls Pin
Gerry Schmitz29-Oct-20 13:44
mveGerry Schmitz29-Oct-20 13:44 
GeneralRe: Naming added Controls Pin
Member 1495490329-Oct-20 13:49
Member 1495490329-Oct-20 13:49 
GeneralRe: Naming added Controls Pin
Gerry Schmitz30-Oct-20 7:25
mveGerry Schmitz30-Oct-20 7:25 
QuestionFail to call Sub from Async method Pin
Mc_Topaz27-Oct-20 23:38
Mc_Topaz27-Oct-20 23:38 
AnswerRe: Fail to call Sub from Async method Pin
Richard Deeming28-Oct-20 1:12
mveRichard Deeming28-Oct-20 1:12 
GeneralRe: Fail to call Sub from Async method Pin
Mc_Topaz28-Oct-20 1:59
Mc_Topaz28-Oct-20 1:59 
QuestionCannot insert into Oracle 11g R2 Pin
kerek224-Oct-20 18:14
kerek224-Oct-20 18:14 
AnswerRe: Cannot insert into Oracle 11g R2 Pin
Victor Nijegorodov24-Oct-20 20:40
Victor Nijegorodov24-Oct-20 20:40 
GeneralRe: Cannot insert into Oracle 11g R2 Pin
kerek225-Oct-20 12:47
kerek225-Oct-20 12:47 
GeneralRe: Cannot insert into Oracle 11g R2 Pin
Dave Kreskowiak25-Oct-20 14:09
mveDave Kreskowiak25-Oct-20 14:09 
GeneralRe: Cannot insert into Oracle 11g R2 Pin
Victor Nijegorodov25-Oct-20 21:04
Victor Nijegorodov25-Oct-20 21:04 
GeneralRe: Cannot insert into Oracle 11g R2 Pin
kerek226-Oct-20 15:38
kerek226-Oct-20 15:38 
GeneralRe: Cannot insert into Oracle 11g R2 Pin
Dave Kreskowiak26-Oct-20 16:58
mveDave Kreskowiak26-Oct-20 16:58 
QuestionProcess Count Pin
Member 1495490323-Oct-20 23:55
Member 1495490323-Oct-20 23:55 
AnswerRe: Process Count Pin
Sandeep Mewara24-Oct-20 1:00
mveSandeep Mewara24-Oct-20 1:00 
GeneralRe: Process Count Pin
Member 1495490324-Oct-20 1:51
Member 1495490324-Oct-20 1:51 
QuestionCefsharp Waiting for page load Pin
Member 1495490322-Oct-20 8:26
Member 1495490322-Oct-20 8:26 
QuestionCalling vb function from java script in Gizmox WebGUI application Pin
Ridha.soft21-Oct-20 22:26
Ridha.soft21-Oct-20 22:26 
AnswerRe: Calling vb function from java script in Gizmox WebGUI application Pin
OriginalGriff21-Oct-20 22:35
mveOriginalGriff21-Oct-20 22:35 
QuestionConnection string for Integrated Security Pin
Member 1362432514-Oct-20 10:14
Member 1362432514-Oct-20 10:14 
Hello:
I am trying to connection using old school VBA.

This works in VBA!
connectionString = "Provider=sqloledb;Data Source=w2012;Initial Catalog=M1_SU;User Id=m1view;Password=connect2m1;"

This works in VB.NET, but says the server does not exist or access is denied...
"Provider=sqloledb;Data Source=sage;Initial Catalog=JobSheet;persist security info=True;Integrated Security=SSPI;"

Why would the server be available in VB.NET but not in VBA?

Here's the complete code.  I must be missing something..
Sub GetJobs_Click()
    Dim connectionString As String
    ' connectionString = "Provider=sqloledb;Data Source=w2012;Initial Catalog=M1_SU;User Id=m1view;Password=connect2m1;"
    connectionString = "Provider=sqloledb;Data Source=sage;Initial Catalog=JobSheet;persist security info=True;Integrated Security=SSPI;"
    Dim cn As ADODB.Connection
    Set cn = New ADODB.Connection
        
    Dim rs As ADODB.Recordset
    Set rs = New ADODB.Recordset
        
    Dim sql As String
    sql = "SELECT * From [JobSheet].[dbo].[JobInfo] ORDER BY JobNo "
    MsgBox (sql)
        
    cn.connectionString = connectionString
    [COLOR="#FF0000"]cn.Open ' ERROR'S HERE[/COLOR]
        
    rs.Open sql, cn, adOpenKeyset, adLockReadOnly, adCmdText
    rs.MoveFirst
    Do While Not rs.EOF
        MsgBox (rs.Fields("JobNo"))
        rs.MoveNext

    Loop

    rs.Close
    Set rs = Nothing
        
    cn.Close
    Set cn = Nothing

End Sub


Thanks!

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.