question about writing SQL

A

Adam Sandler

Hello,

Using VWD 2005 here... I have a question about writing SQL in a
TableAdapter. Our DB server here is Oracle but since I'm just
prototyping right now, I created a copy of the table I need in Access
and I'm connecting to Access on my local machine.

I right-clicked my TableAdapter and selected Add Query... | the Use SQL
Statements radio button | Delete. This was the default statement which
appeared in the Query Configuration Wizard "DELETE FROM [T_PERSONNEL]
WHERE (([N_EVENTID] = ?))"

The table has a name column. I don't expose N_EVENTID on the webpage.
So I clicked the Query Builder button because I want to change the
column in the where clause from N_EVENTID to S_NAME. I give the query
the name of "myDeleteQuery" and click finish.

In the code behind, this is the code attached to a button...

Dim ta As New DataSet1TableAdapters.T_PERSONNELTableAdapter
ta.myDeleteQuery(Me.Edit1.Text)

Here's where the problem arises... I get Invalid precision errors when
the above code is executed. Some simple debugging shows what is going
on. What is getting sent to the DB is myDeleteQuery(S_NAME As String)
As Integer.

1. Is there a way to keep the IDE from casting the SQL to another type
when using the query builder?

2. Is it becuase I changed the column from N_EVENTID to S_NAME in the
SQL wizard?

3. The XML for the table adapter shows has DbType="String", so again,
I'm confused as to why VWD puts the As Integer on the end of my method.
In Access, can one only delete a row by the primary key?

Thanks!
 
A

Adam Sandler

I found the answer out... for some reason the length in the tbale
adpater properties was 1024... it should be 255. I don''t know why it
got set to 1024 but I was able to delete the query and recreate the
problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top