VB.Net - ADODB, trying to get ODBC Driver?

Soldato
Joined
4 Nov 2007
Posts
4,514
Code:
        Dim ConnectDB As New ADODB.Connection
        Dim ConnectRS As New ADODB.Connection
        Dim MyTable As String

        ConnectDB.Open("Provider=sqloledb;" & "Data Source=hbcsql3;" & "Initial Catalog=mailreader;" & "User Id=***;" & "Password=***;")

        MyTable = "select * from mail_info"
        ConnectRS.Open(MyTable, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic, -1)

50156331bh2.png


Reeeeally need to avoid ODBC Drivers as it needs to be used by a mass amount of remote users. Does ADODB still work in VB.net? Been using VB6 till today, added the Microsoft ActiveX Database Object 2.7 reference.

Help.
 
Still getting same error on the same line, took the -1 out as .Open cannot handle that many arguments.

This is far too complex for me, I can probably do what I need with the data once I get a connection, anyone fancy giving me a hand and writing the connection string?
 
Wahey, it runs!

Form some reason the form is blank, and I can't get into edit it =/

All the code for objects is still there :S

Code:
    Private Sub InitializeComponent()
        Me.LContract = New System.Windows.Forms.Label
        Me.Label2 = New System.Windows.Forms.Label
        Me.TBRecords = New System.Windows.Forms.TextBox
        Me.Label3 = New System.Windows.Forms.Label
        Me.TBName = New System.Windows.Forms.TextBox
        Me.Button1 = New System.Windows.Forms.Button
        Me.CheckBox1 = New System.Windows.Forms.CheckBox
        Me.SuspendLayout()
        '
        'LContract
        '
        Me.LContract.AutoSize = True
        Me.LContract.Location = New System.Drawing.Point(12, 9)
        Me.LContract.Name = "LContract"
        Me.LContract.Size = New System.Drawing.Size(39, 13)
        Me.LContract.TabIndex = 0
        Me.LContract.Text = "Label1"
        '
        'Label2
        '
        Me.Label2.AutoSize = True
        Me.Label2.Location = New System.Drawing.Point(12, 22)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(67, 13)
        Me.Label2.TabIndex = 1
        Me.Label2.Text = "Read by | on"
        '
        'TBRecords
        '
        Me.TBRecords.Location = New System.Drawing.Point(15, 38)
        Me.TBRecords.Name = "TBRecords"
        Me.TBRecords.Size = New System.Drawing.Size(265, 20)
        Me.TBRecords.TabIndex = 2
        '
        'Label3
        '
        Me.Label3.AutoSize = True
        Me.Label3.Location = New System.Drawing.Point(12, 163)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(200, 13)
        Me.Label3.TabIndex = 3
        Me.Label3.Text = "Please enter your name and tick the box."
        '
        'TBName
        '
        Me.TBName.Location = New System.Drawing.Point(15, 179)
        Me.TBName.Name = "TBName"
        Me.TBName.Size = New System.Drawing.Size(163, 20)
        Me.TBName.TabIndex = 4
        '
        'Button1
        '
        Me.Button1.Location = New System.Drawing.Point(205, 179)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(75, 23)
        Me.Button1.TabIndex = 5
        Me.Button1.Text = "Submit"
        Me.Button1.UseVisualStyleBackColor = True
        '
        'CheckBox1
        '
        Me.CheckBox1.AutoSize = True
        Me.CheckBox1.Location = New System.Drawing.Point(184, 182)
        Me.CheckBox1.Name = "CheckBox1"
        Me.CheckBox1.Size = New System.Drawing.Size(15, 14)
        Me.CheckBox1.TabIndex = 6
        Me.CheckBox1.UseVisualStyleBackColor = True
        '
        'Post
        '
        Me.ClientSize = New System.Drawing.Size(292, 208)
        Me.Controls.Add(Me.CheckBox1)
        Me.Controls.Add(Me.Button1)
        Me.Controls.Add(Me.TBName)
        Me.Controls.Add(Me.Label3)
        Me.Controls.Add(Me.TBRecords)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.LContract)
        Me.Name = "Post"
        Me.Text = "Mail Acknowledgement"
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub

Any clues a side from rebuilding the entire form, it's not the first time it's done it either.
 
Back
Top Bottom