Click here to Skip to main content
15,887,683 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionsending message plugins Pin
Member 1322979929-May-17 14:50
Member 1322979929-May-17 14:50 
AnswerRe: sending message plugins Pin
Richard MacCutchan29-May-17 20:49
mveRichard MacCutchan29-May-17 20:49 
AnswerRe: sending message plugins Pin
ZurdoDev2-Jun-17 3:16
professionalZurdoDev2-Jun-17 3:16 
QuestionWanting to use a For Next variable in “xxxx.Rows.Count” Pin
smdevivo23-May-17 16:05
professionalsmdevivo23-May-17 16:05 
AnswerRe: Wanting to use a For Next variable in “xxxx.Rows.Count” Pin
Maciej Los23-May-17 20:55
mveMaciej Los23-May-17 20:55 
QuestionRe: Wanting to use a For Next variable in “xxxx.Rows.Count” Pin
ZurdoDev24-May-17 4:02
professionalZurdoDev24-May-17 4:02 
AnswerRe: Wanting to use a For Next variable in “xxxx.Rows.Count” Pin
Member 834559924-May-17 6:33
Member 834559924-May-17 6:33 
QuestionCreating Access 2007+ files Pin
JR21222-May-17 18:47
JR21222-May-17 18:47 
Hi,

I try to create an access 2007 or higher file.
I wrote this testcode just an simple form with 2 buttons.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnMake.Click
    Dim dlg As New SaveFileDialog

    With dlg
      .Filter = "Access(.accdb)|.accdb"
      If .ShowDialog = DialogResult.OK Then
        Dim cat As New ADOX.Catalog()
        Try
          cat.Create("Provider=Microsoft.ACE.OLEDB.102.0;Data Source=" & .FileName & ";Persist Security Info=True")
          'cat.Create("Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=" & .FileName)
        Catch ex1 As Exception
          MsgBox(ex1.Message)
          If MsgBox("Is Microsoft Access Database Engine 2010 Redistributable installed?", vbQuestion Or MsgBoxStyle.YesNo) = MsgBoxResult.No Then
            Try
              Process.Start("<a href="https://www.microsoft.com/en-us/download/details.aspx?id=13255">https://www.microsoft.com/en-us/download/details.aspx?id=13255</a>")<br />
              MsgBox("Do it :)", MsgBoxStyle.SystemModal)
            Catch ex2 As Exception

            End Try
          End If
        Finally
          cat = Nothing
        End Try
      End If
    End With
  End Sub

  Private Sub Button2_Click(sender As Object, e As EventArgs) Handles btnOpen.Click
    Dim dlg As New OpenFileDialog

    With dlg

      .Filter = "Access(.accdb)|.accdb"
      If .ShowDialog = DialogResult.OK Then

        Dim OLEConnection As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & .FileName & ";Persist Security Info=True")
        OLEConnection.Open()

        Dim OLECommand As New OleDb.OleDbCommand("", OLEConnection)
        ' Before this line you can create a string that holds your build for the table structure
        Randomize()
        Dim t As Int64 = Int(Rnd() * 100000)
        Try
          OLECommand.CommandText = "CREATE TABLE mytable" & t & " (field1 CHAR,field2 NUMBER)"
          OLECommand.ExecuteNonQuery()
          MsgBox("Table " & t & " maded")

          OLECommand.CommandText = "insert into mytable" & t & " values(""" & t & """, " & t & ")"
          OLECommand.ExecuteNonQuery()

          OLECommand.Connection.Close()
        Catch ex As Exception
          MsgBox(ex.Message)
        End Try

      End If
    End With
  End Sub

Create a table works. However making a file Always fails.
Can anyone gives me idaes?

I've tryed installing the 32 and 64 bit version of Microsoft Access Database Engine 2010 Redistributable
I'm working on a W10 machine 64bit

Jan
AnswerRe: Creating Access 2007+ files PinPopular
Richard MacCutchan22-May-17 21:54
mveRichard MacCutchan22-May-17 21:54 
GeneralRe: Creating Access 2007+ files Pin
JR21224-May-17 1:38
JR21224-May-17 1:38 
AnswerRe: Creating Access 2007+ files Pin
Maciej Los23-May-17 20:25
mveMaciej Los23-May-17 20:25 
QuestionYahoo Finance API Throwing 504 Status? Pin
Member 1321215119-May-17 22:57
Member 1321215119-May-17 22:57 
AnswerRe: Yahoo Finance API Throwing 504 Status? Pin
Afzaal Ahmad Zeeshan19-May-17 23:56
professionalAfzaal Ahmad Zeeshan19-May-17 23:56 
QuestionOutlook signature code suddenly causing "remote procedure call failed" message Pin
Member 1320910118-May-17 7:18
Member 1320910118-May-17 7:18 
AnswerRe: Outlook signature code suddenly causing "remote procedure call failed" message Pin
Richard MacCutchan18-May-17 21:43
mveRichard MacCutchan18-May-17 21:43 
GeneralRe: Outlook signature code suddenly causing "remote procedure call failed" message Pin
Member 134178014-Dec-19 3:07
Member 134178014-Dec-19 3:07 
GeneralRe: Outlook signature code suddenly causing "remote procedure call failed" message Pin
Richard MacCutchan4-Dec-19 3:28
mveRichard MacCutchan4-Dec-19 3:28 
GeneralRe: Outlook signature code suddenly causing "remote procedure call failed" message Pin
Member 134178014-Dec-19 3:32
Member 134178014-Dec-19 3:32 
GeneralRe: Outlook signature code suddenly causing "remote procedure call failed" message Pin
Richard MacCutchan4-Dec-19 3:45
mveRichard MacCutchan4-Dec-19 3:45 
QuestionRetrieving value from an XML file Pin
Ben Senior17-May-17 8:32
Ben Senior17-May-17 8:32 
GeneralRe: Retrieving value from an XML file Pin
PIEBALDconsult17-May-17 14:11
mvePIEBALDconsult17-May-17 14:11 
GeneralRe: Retrieving value from an XML file Pin
Ben Senior17-May-17 22:33
Ben Senior17-May-17 22:33 
GeneralRe: Retrieving value from an XML file Pin
Richard MacCutchan17-May-17 23:08
mveRichard MacCutchan17-May-17 23:08 
GeneralRe: Retrieving value from an XML file Pin
Ben Senior19-May-17 7:40
Ben Senior19-May-17 7:40 
GeneralRe: Retrieving value from an XML file Pin
Richard MacCutchan19-May-17 21:13
mveRichard MacCutchan19-May-17 21: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.