hi:
i m new to VB6.thatswhy i have some problem in connecting
VB with sql server.actually i m able to connect but it would nt run the query,giving me the run time error "invalid object name <tablename>".
in the begining i thought i have probelm with the name but i changed the name.
then i thought it might have something to do with database permissions.i did checke that but for some reason the error would nt go away.
here is the code
Private Sub btnSubmit_Click()
Dim Conn As New ADODB.Connection
Dim RecSet As New ADODB.Recordset
Dim SQLQuery
Fname = txtFname.Text 'getting var from text box
Lname = txtLname.Text
'The database is on romote server
SQLQuery = "Insert into introduction (fname,lname) values ('" & Fname & "','" & Lname & "')"
Conn.Open "Provider=SQLOLEDB.1;UID=someID;PWD=myPWD;Inti tial Catalog=test;Data Source=MYserver"
RecSet.Open SQLQuery, Conn
Conn.Close
Set RecSet = Nothing
End Sub
This code runs under a command button click.i m getting the values from the text boxes and try to insert them in the database.but i m getting this weird error.
Please help!!!!