Hi,
I am new to SQL Server. I am attempting to execute an insert query,
but I keep getting an entire range of errors depending on which way I
choose to do it. Can anybody tell me what is wrong with my code below?
"txtkeyword " is a text box on my form.
Thanks in advance,
Daniel McDonald
Dim mySQL As String
Dim myRecSet As ADODB.Recordset
Dim myConnection As New ADODB.Connectio n
mySQL = "INSERT INTO tblcustomerfind ( CompanyName )SELECT
tblcustomer.Com panyName"
mySQL = mySQL & " From tblcustomer, tblcustomerfind WHERE
(((tblcustomer. CompanyName) Like '" & txtkeyword & "'%))"
'myConnection.O pen "Provider=sqlol edb;Data Source=Server;I nitial
Catalog=ConSoft ;User Id=Administrato r;Password=jani s01;Integrated
Security=SSPI;"
myConnection.Op en "Provider=MSDAS QL;Driver={SQL
Server};Server= Server;Initial Catalog=ConSoft ;User
Id=Administrato r;Password=jani s01;Integrated Security=SSPI;"
Set myRecSet = myConnection.Ex ecute(mySQL)
I am new to SQL Server. I am attempting to execute an insert query,
but I keep getting an entire range of errors depending on which way I
choose to do it. Can anybody tell me what is wrong with my code below?
"txtkeyword " is a text box on my form.
Thanks in advance,
Daniel McDonald
Dim mySQL As String
Dim myRecSet As ADODB.Recordset
Dim myConnection As New ADODB.Connectio n
mySQL = "INSERT INTO tblcustomerfind ( CompanyName )SELECT
tblcustomer.Com panyName"
mySQL = mySQL & " From tblcustomer, tblcustomerfind WHERE
(((tblcustomer. CompanyName) Like '" & txtkeyword & "'%))"
'myConnection.O pen "Provider=sqlol edb;Data Source=Server;I nitial
Catalog=ConSoft ;User Id=Administrato r;Password=jani s01;Integrated
Security=SSPI;"
myConnection.Op en "Provider=MSDAS QL;Driver={SQL
Server};Server= Server;Initial Catalog=ConSoft ;User
Id=Administrato r;Password=jani s01;Integrated Security=SSPI;"
Set myRecSet = myConnection.Ex ecute(mySQL)
Comment