Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have been Visual Studio 2010 to make display tweeks on a letter writing program which uses a sqlite .db database. whilst using it on an XP machine with Visual Studio 2010 it worked perfectly and the resulting program installs and runs correctly on XP, Win 7 and win10 machines.

My problem is that I have now changed to a win 10 machine with VS 2017 and when the project loaded after conversion it seems to have been changed away from sqlite.
I have sqlite installed and usable on the win 10 machine and have been able to attach the correct database.

Any suggestions as to how to untangle this mess? I am looking for guidance on how to proceed on my rather steep learning curve.

I have copied the start of VB code of the main form below:

What I have tried:

VB
Imports System
Imports System.IO
Imports System.Collections
Imports System.Data.SQLite
Imports Word = Microsoft.Office.Interop.Word
Imports System.Threading
Imports System.Runtime.InteropServices

Public Class Letters
    Dim m_SqlCommand As SqlClient.SqlCommand
    Dim m_tempCommand As SqlClient.SqlCommand
    Dim m_tempReader As SqlClient.SqlDataReader
    Dim m_SqlCommand1 As SqlCommand
    Dim m_SqlReader As SqlDataReader
    Dim m_SqlReader1 As SqlDataReader
    Dim mLetterIndex As String
    Dim mSingleSenderTemplate As String
    Dim mDoubleSenderTemplate As String
    Dim mPDFTemplate As String

    Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        cboSenderOneTitle.Focus()
        Call SetControlValues()
        gbSubHeadingText.Visible = False
    End Sub

    Private Sub btnSelectLetter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSelectLetter.Click
        Call GetControlValues()

        If gSenderOneLastName = gSenderTwoLastName Then
            CombinedSendFrench.Text = (gFR1Title) & " et " & gTitle2FR & " " & gSenderOneForenames & " " & gSenderOneLastName
        ElseIf gSenderOneLastName <> gSenderTwoLastName Then
            CombinedSendFrench.Text = (gFR1Title) & " " & gSenderOneForenames & " " & gSenderOneLastName & " et " & gTitle2FR & " " & gSenderTwoForenames & " " & gSenderTwoLastName
        End If



        Dim mstrSQL As String
        Dim conn As New SqlConnection()
        conn.ConnectionString =DataSource=.\SQLlite;AttachDbFilename=LetterSelectorDB.db" & Application.StartupPath & "\" & "LetterSelectorDB.db" & ";Integrated Security=True;User Instance=True"
        conn.Open()
Posted
Updated 25-Aug-18 10:54am
v2

1 solution

Start by adding a double quote in here:
conn.ConnectionString =DataSource
so it looks like this:
conn.ConnectionString ="DataSource
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900