Showing posts with label joins. Show all posts
Showing posts with label joins. Show all posts

Tuesday, March 20, 2012

re: This recordset is not updatable

Hi all,

I created a form that links to a view. The view joins the two tables and both of these tables are defined w/ Primary keys. But when I try to update the table is giving an error in Access form: "This recordset is not updatable".
Would anyone have an explanation for this?
I'm using AC2K and SQL Server 2K.
Thanks!You can only update columns in the view from one table with one update statement. You can only update columns if you have all of the columns in the declared PK for the table in the view.

-PatP

Wednesday, March 7, 2012

RDA.Pull and INNER JOINS...

When calling the method below, if I use the SQL in red, the Pull method populates my data correctly. But, If I use the sql in Green, I get an errror message. I have set breakpoints and un the SQL that is returned from the sql statement is green, and it returns records. What gives? Are Joins not allowed?

public void GetDiagnosisList()
{
// Connection string to SQL Server 2000
string rdaOleDbConnectString = "Provider=sqloledb; Data Source=WORKPC;Initial" +
" Catalog=database;User Id=username;Password=password";
// string SQLGet = "SELECT tblLUDiagnosis.strDiagnosisCode, tblLUDiagnosis.strDiagnosisDesc FROM tblLUDiagnosis" +
// " INNER JOIN tblPatientEpisode ON tblLUDiagnosis.strDiagnosisCode = tblPatientEpisode.strPrimaryDiagnosis" +
// " WHERE tblPatientEpisode.intHospitalID =" + intHospitalID;
string SQLGet = "SELECT TOP 15 tblLUDiagnosis.strDiagnosisCode, tblLUDiagnosis.strDiagnosisDesc FROM tblLUDiagnosis";
SqlCeRemoteDataAccess rda = new SqlCeRemoteDataAccess();
try
{
rda.InternetUrl = "http://WORKPC/SQLCE/sscesa20.dll";
rda.LocalConnectionString = "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;" + CONN_STRING;
rda.Pull("tblLUDiagnosis",SQLGet,rdaOleDbConnectString, RdaTrackOption.TrackingOnWithIndexes, "ErrorTable");
MessageBox.Show("Diagnosis Synchronized");
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}

nevermind, got it...it was the

TrackingOnWithIndexes...can't use that and join statements...Thanks