Click here to Skip to main content
14,921,505 members
Home / Discussions / Visual Basic
   

Visual Basic

 
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
MemberMember 1495490323-Oct-20 23:55 
AnswerRe: Process Count Pin
Sandeep Mewara24-Oct-20 1:00
mvaSandeep Mewara24-Oct-20 1:00 
GeneralRe: Process Count Pin
Member 1495490324-Oct-20 1:51
MemberMember 1495490324-Oct-20 1:51 
QuestionCefsharp Waiting for page load Pin
Member 1495490322-Oct-20 8:26
MemberMember 1495490322-Oct-20 8:26 
QuestionCalling vb function from java script in Gizmox WebGUI application Pin
Ridha.soft21-Oct-20 22:26
MemberRidha.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
MemberMember 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!

AnswerRe: Connection string for Integrated Security Pin
Dave Kreskowiak14-Oct-20 17:04
mveDave Kreskowiak14-Oct-20 17:04 
GeneralStar Rating In Microsoft Outlook 2016 Pin
Member 1341109113-Oct-20 21:07
MemberMember 1341109113-Oct-20 21:07 
QuestionInsert timestamp using datareader to oracle date Pin
kerek25-Oct-20 18:16
Memberkerek25-Oct-20 18:16 
AnswerRe: Insert timestamp using datareader to oracle date Pin
Richard Deeming5-Oct-20 21:26
mveRichard Deeming5-Oct-20 21:26 
AnswerRe: Insert timestamp using datareader to oracle date Pin
Victor Nijegorodov5-Oct-20 21:40
MemberVictor Nijegorodov5-Oct-20 21:40 
AnswerRe: Insert timestamp using datareader to oracle date Pin
DerekT-P5-Oct-20 22:31
professionalDerekT-P5-Oct-20 22:31 
GeneralRe: Insert timestamp using datareader to oracle date Pin
kerek26-Oct-20 3:50
Memberkerek26-Oct-20 3:50 
GeneralRe: Insert timestamp using datareader to oracle date Pin
kerek27-Oct-20 15:37
Memberkerek27-Oct-20 15:37 
GeneralRe: Insert timestamp using datareader to oracle date Pin
Dave Kreskowiak7-Oct-20 17:58
mveDave Kreskowiak7-Oct-20 17:58 
GeneralRe: Insert timestamp using datareader to oracle date Pin
kerek226-Oct-20 20:27
Memberkerek226-Oct-20 20:27 
GeneralRe: Insert timestamp using datareader to oracle date Pin
Richard Deeming26-Oct-20 22:19
mveRichard Deeming26-Oct-20 22:19 
GeneralRe: Insert timestamp using datareader to oracle date Pin
kerek227-Oct-20 13:47
Memberkerek227-Oct-20 13:47 
GeneralRe: Insert timestamp using datareader to oracle date Pin
Dave Kreskowiak27-Oct-20 6:48
mveDave Kreskowiak27-Oct-20 6:48 
GeneralRe: Insert timestamp using datareader to oracle date Pin
kerek227-Oct-20 16:32
Memberkerek227-Oct-20 16:32 
GeneralRe: Insert timestamp using datareader to oracle date Pin
Dave Kreskowiak27-Oct-20 18:27
mveDave Kreskowiak27-Oct-20 18:27 
GeneralRe: Insert timestamp using datareader to oracle date Pin
kerek229-Oct-20 14:11
Memberkerek229-Oct-20 14:11 
GeneralRe: Insert timestamp using datareader to oracle date Pin
Dave Kreskowiak29-Oct-20 14:13
mveDave Kreskowiak29-Oct-20 14:13 

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.