|
Hi guys I'm accessing MS Access database from an ASP.NET page but I can't seem to be able to delete, insert or update any row in the database. I'm tryin the ExecuteNonQuery Method of the Command bject but in all cases I get an error saying that "System.Data.OleDb.OleDbException: Operation must use an updateable query"
However retrieving records from teh same access database using executereader works just fine.
I really need to find out whats wrong here.
|
|
|
|
|
gamerPotatoe wrote:
System.Data.OleDb.OleDbException: Operation must use an updateable query
Try to check the information from here.[^]
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
I am trying to fill crystal report from typed dataset which has three tables and all are interlinked. When i set datasource of crystal report to that dataset and links the table in visual linking expert after doing every thing this is the code i am writing.
Dim con As SqlConnection = New SqlConnection("ConnectionString")
Dim da As SqlDataAdapter = New SqlDataAdapter("Select Statement", con)
Dim ds As DataSet = New Dataset1
Dim cr As New CrystalReport1
da.Fill(ds)
DataGrid1.DataSource = ds.Tables(3)
cr.SetDataSource(ds.Tables(3))
CrystalReportViewer1.ReportSource = cr
The datagrid is filled but crystal report is showing no results. how can i fill cr.
|
|
|
|
|
Hi,
In my current project i am using datagrid to display record from the employee table
It consist of four feild.
EmpName joiningdate Department Designation
John 14/12/90 10 Clerk
Smith 10/01/85 20 Programmer
Smith 11/05/95 20 Programmer
I need to know what column a user has selected and and the complete data of that row.
e.g. if a user select Smith then how i can take his joining date from the data grid.
ename=datagrid.text //giving me the name of the employee
rownum=datagrid.row // giving the selected row number
colnum=datagrid.col // giving the selected col number
Thanks in advance
|
|
|
|
|
Is there a way in VB6 to achieve the 'Windowshade' effect that exists on the Mac? By this I mean a way to intercept double-clicking on the TitleBar and instead of the Window expanding to MaxSize, have the client portion shrink to nothing so that only the TitleBar is showing. Double-Clicking again would restore the client area to its previous state...
Thanks,
Tim
|
|
|
|
|
It would be FAR easier to do in C++ than it would in VB6. VB6 doesn't support the hooking that would be required to pull something like this off.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello...
I need help in VB to determine the highest value between 3 data.
For example, I have 3 textboxes with numeric value.
Txt1 = 8
Txt2 = 7
Txt3 = 4
And then, I have another textbox to display the result. TxtResult
If txt1 has the highest value, then TxtResult = Txt1
Can anybody help me with the code?
Thanks.
|
|
|
|
|
This has all the signs of homework. Sorry, but we'll help you with YOUR code, we're not writing it for you.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave is completely right.
but in order to help you:
You should use some CONDITIONAL STATEMENTS to check which textbox has the highest value.
If...End If and Select...End Select
|
|
|
|
|
I am importing records from a ODBC Database into Access. The import works fine, except I get duplicate entries in my Access Database. I need to run this process once a week. Can anyone tell me how I can eliminate importing the duplicate entries to my Access. Thanks.
Private Sub ImportToAccess()
Dim Con1 As New ADODB.Connection
Dim Con2 As New ADODB.Connection
Dim mySQL1 As String
Dim mySQL2 As String
Dim myDSN As String
Dim mySET As String
Dim tmpTable As String
'Connection parameters for Source Database
myDSN = "DSN=Springbrook1;UID=suresh;PWD=******;"
mySET = "set schema 'pub'"
mySQL2 = "select * from customer"
'Open Source Database
Con2.Open myDSN
Con2.Execute (mySET)
'Open Destination Database
Con1.Open _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Temp\VB Sample Codes\mcwd\Connect Program\test1.mdb;" & _
"Jet OLEDB:Engine Type=5;"
'WORKS BUT CREATES DUPLICATE RECORDS
mySQL1 = "INSERT INTO [C:\Temp\VB Sample Codes\mcwd\Connect Program\test1.mdb].[tblCustomer] SELECT (Cust_No, First_Name) FROM [odbc;DSN=Springbrook1;UID=suresh;PWD=******;].[Customer]"
Con1.Execute mySQL1
Con1.Close
Con2.Close
Set Con1 = Nothing
Set Con2 = Nothing
End Sub
|
|
|
|
|
if you're having problems importing duplicate records then the problem is with your A.) Data or B.) database design.
you might be better off finding help in the ADO/SQL forum, or if you'd like you can post what your tables look like and i can hve a quick look for you.
-jim
|
|
|
|
|
Jim:
It is a simple Table with 4 fields in it. An auto ID Field, Cust No Field, First Name Field and a Entry Time Field.
tblCustomer
ID
Cust_No
First_Name
Entry_Time
Each time the code is run, a new set of data is added to my Table. What I am trying to do is just to be able to update my table. Does this clarify the question?
Thanks
|
|
|
|
|
what is the primary key of the table? does the table you're pulling from have a primary key as well, and is the structure the same?
-jim
|
|
|
|
|
The primary key in both tables is Cust_No. The structure is the same. However, the infomation inthe primary table may have the same information in Primary Field, but the rest of the data may cahnge. So while importing, I need to make sure it imports the modified or new data in the secondary table. Does this helps with question?
|
|
|
|
|
In that case, you're going to need alot more code than this. You have to first check if the Cust_No exists in the table your copying this data to. If so, then you have to update that record with the new data. If not, you have to INSERT the new data.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
THanks Dave:
I will try the statements. I assume the SELECET, UPDATE AND INSERT Statements will be used?
|
|
|
|
|
Hey Guys
Try this:
<Serializable()> Public Class TestClass
Public A As Integer = 100
Public ASpecified As Boolean
End Class
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ser As New System.Xml.Serialization.XmlSerializer(GetType(TestClass))
Dim ms As New IO.MemoryStream
ser.Serialize(ms, New TestClass)
MsgBox(System.Text.ASCIIEncoding.UTF8.GetString(ms.ToArray))
End Sub
Then try changing ASpecified to Integer .
There seems be a problem with serializable methods/fields that end with the word Specified, can anyone else confirm that I'm not going round the bend... it's been an afternoon of pulling what little hair I have out tracking it down!
Cheers
Tom
|
|
|
|
|
I was wondering how to trap the backspace key with the keyPress event. Anyhelp would be much appreciated
Brian Van Beek
|
|
|
|
|
i assume you're talking about the keypress of a textbox, so in your keypress event handler...
if (e.keycode = keys.back) then
'keys.back indicates the backspace key
'perform something here...
end if
hope this helps.
-jim
|
|
|
|
|
i'm working on a program right now, and i need show some informations on a form, but fact that information could be more than i thought, i need to create some labels at run time and place them on the form.
so, my Q is : how to create those labels at run time please?
regarding to you guys, sincere love.
marc
|
|
|
|
|
creating them is pretty easy...
dim c as new windows.forms.control
dim b as new windows.forms.button
dim l as new windows.forms.label
the problem you're going to have is setting the location appropriately since the placement will have to be dynamic.
you can set the location for the controls by using:
c.location = new drawing.point(x,y)
etc.
hope this helps.
-jim
|
|
|
|
|
Hello Jim,
hope u're fine. Hum... i'm trying ur codes and an error occurs
at the first line.
ERROR is : "COMPILE ERROR
User-defined type not defined."
i forgot to mention that i was using vb6, so i don't if it's the real reason
of that occured error. i dont know what do u think about that?
let me know about that.
sincerely yours
marc
|
|
|
|
|
yeah, this code was for vb.net.
i'm not sure if you can create controls dynamically at run-time in vb6. frankly i haven't worked with vb classic that much.
perhaps someone more experienced like dave can help you out.
sorry.
-jim
|
|
|
|
|
Thank u Jim for ur help anyway.
i appreciate effort u've done for me.
marc
|
|
|
|
|
In addition to what Jim said, you're also going to have to add the newly created control to the Form's Controls collection too.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|