|
Hi,
I tried to pass VB 6.0 form parameters to SQl queries by using the following code :
Option Explicit
Dim cn As Connection
Dim strsql As String
Dim rssname As ADODB.Recordset
Dim strsql as string
Private Sub Form_Load()
Set cn = New ADODB.Connection
cn.ConnectionString = "DSN=dataentry"
cn.open "Provider=Microsoft.Jet.OLEDB.4.0;DataSource=D:\WeikField\Survey_Project\DataEntry.mdb;"
End Sub
Private Sub cmdrepsearch_Click()
strsql = ""
strsql = "SELECT * FROM Data_Entry WHERE Data_Entry.Surveyor_Name='" & cmbrepsname & "'"
rssname.open strsql, cn
DataReportSName.Refresh
DataReportSName.Show
rssname.Close
End Sub
Now the problem is that I am getting runtime error. The error description is as follows :
Runtime Error '91': Object variable or With block variable not set.
Plz can anyone help me out.
Success is not a Destination,
... But a Journey !!
|
|
|
|
|
A couple of pointers
1. You're missing a new keyword (this should solve the object block variable error)
2. You set the connection string property for the connection as a DSN and then use a completely different string when you actually open the connection,thus ignoring the dsn - either use
cn.ConnectionString = "DSN=Dataentry"
cn.open
OR
cn.open("Provider=Microsoft.Jet.OLEDB.4.0;DataSource=D:\WeikField\Survey_Project\DataEntry.mdb;")
Hope that helps
"If i was king cigarettes would be free."
|
|
|
|
|
Well thanx brendan for ur response.I'll surely try one of these things and let u know.
Thanx & Regards.
Success is not a Destination,
... But a Journey !!
|
|
|
|
|
Hi Brendan,
Thanx for ur support.
The problem is solved.
Thanx & Regards.
Success is not a Destination,
... But a Journey !!
|
|
|
|
|
I am unable to pass parameter between window forms in vb.net? how could i do so?
please help
MPandey/INDIA
|
|
|
|
|
Please do a search on the forum. This topic was discussed many times...
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
|
i am using Visual basic application with MS SQL server as backend. i am facing a peculiar problem.
in the application i got a form thru which records are entered ,i got few tables as master tables whose records(field values) are selected and displayed in the combo of the application form.when a new record is entered it properly displays and inserts the record to another table. the problem is when ever a textbox value is changed other than the combo in that particular form the value of combo automaticaly chages to the first value of the record from which it is extracted from the master table. this happens only after editing any value from the entry form update and quit. i am using sys.generated id to get the value for combo.
All the combos used in the form will automatically goes to the first record of the particular tables from whcih it is absorbed ..coutles time i have chaged the codes as well as the update procedures called in the application ...can anybody try this
cc
|
|
|
|
|
I don't have any problems with bound ComboBoxes. Without seeing the code your using to fill the dataset and bind the ComboBox, it's pretty difficult to tell you whats going wrong.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi, Furher
Plz specify the dataaccess control ur using.
u need to go through ur code and verify that the recordset does not move to the first record of the table.
Success is not a Destination,
... But a Journey !!
|
|
|
|
|
hi everyone
I'm writing an applciation in wich I use a toggle button. On the button is a picture:
me.ToggleButton.picture = new bitmap(application.startuppath & "\afbeeldingen\min.png"
Now the button has to be set disabled on startup. So i write the following code:
me.Togglebutton.enabled=false
It works, but the picture on my button becomes a gray rectangle??? (so I don't see my picture anymore when disabled)
Anyone any ideas
thx in advance
|
|
|
|
|
hi, does anybody know how to add methods in an existing function of an inherited control?
example:
i inherited from a grid control that has a column function - grid.column(byval Col as integer) as Grid.Column
i would like to add a method named getsum() that would get the sum of all numeric values for a particular column so that it would look like grid.column(3).getsum()
how do i do this? i would really appreciate anybodys help.. thanks a lot!
|
|
|
|
|
Using your example, a Columns "function" is not a "function". It's a Collection class. So, in order to add any functionality to this collection, you have to create your own Collection class, inheriting from the original collection class, just like you did for the Grid control. You'll then have to replace the collection in the Grid control with your collection class.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks for the insight.. can you give me a code example? this is somewhat new to me.. thanks!
|
|
|
|
|
RageInTheMachine9532.. how do i replace the collection in the grid control with my new collection class? this is what i did..
Public Class GridExtension
.... other methods here
Public Class ColumnClass
Inherits Grid.Column
Public Function GetSum() as Double
Return <something>
End Function
End Class
End Class
is this what you mean?
|
|
|
|
|
HELLO I AM DEVELOPING VB.NET PROJECT IN WHICH I HAVE TO IDENTIFY MULTIPLE SELECTED ROWS (USING CONTROL KEY AND HAVE TO UPDATE COLUMN OF ALL SELECTED ROWS).I DID UPDATE SINGLE ROW AT A TIME BUT I NEED TO UPDATE MULTIPLE ROWS AT A TIME(BATCH UPDATION).THIS IS VERY URGENT ,I NEED YOUR HELP.
hi this ajay bharti
|
|
|
|
|
First of all, STOP YELLING! People are trying to write code around here...
Next, what version of VB.NET are you using and what control are you using to display and select these records?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i am using visual studio.net 2003 and using datagrid control.if i would use component one through database grid then how to identify multiple selected rows.
i have update a particular column in selected rows of datagrid .
hi this ajay bharti
|
|
|
|
|
You're looking for the IsSelected property of each row in the DataView that the DataGrid is bound to.
See this[^] for a clear example of how to return all the selected rows.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
As every time to build the project, the new version number will generate,
How can I get the version number like (1.0.2635)?
|
|
|
|
|
.NET
msgbox (Application.ProductVersion)
VB6
msgbox App.Major & "." & App.Minor & "." & App.Revision
"If i was king cigarettes would be free."
|
|
|
|
|
Version vv= new Version();
Response.Write(vv.Major+vv.Minor+vv.Build+vv.Revision);
get the version number
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshres
http://himabinduvejella.blogspot.com
|
|
|
|
|
Hi!
in my below code how can i instantiate datagrid webcontrol so that i get each dataview binded to seperate datagrid.
say datagrid1 will hold one dataview, datagrid2 will hold another dataview and so on...
currently i only have datagrid1 webcontrol which only picks the last dataview in loop. please help.
eventually that datagrid will be replaced by some charting tool. so i actually wanted to know how to instantiate webchart webcontrol if i use any third party webchart control
for eg.
MycosChartWeb1.DataSource = CreateData()
MycosChartWeb1.DataBind()
-----------------------
objConn = New SqlConnection(dbPath)
Try
'select the table with only distinct ID based
cmd = New SqlCommand("select distinct measure_id from measuredata m, textdata t where t.ScoreCardId = m.ScoreCardId", objConn)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim dtId As New DataTable("MeasureId")
da.Fill(dtId)
'select all columns with ID
Dim cmd1 As SqlCommand = New SqlCommand("select * from measureData", objConn)
Dim da1 As SqlDataAdapter = New SqlDataAdapter(cmd1)
Dim dt As New DataTable("MeasureSource")
da1.Fill(dt)
Dim myView As New DataView(dt)
Dim datarow As DataRow
For Each datarow In dtId.Rows
myView.RowFilter = String.Format("Measure_Id='{0}'", datarow.Item("measure_Id"))
'######## checking if the dataview works #########
DataGrid1.DataSource = myView
DataGrid1.DataBind()
Next datarow
Catch ex As Exception
Response.Write("OOPs what went wrong:" + ex.ToString)
Finally
End Try
------------------------------
hope my question makes sense for what i wanna achieve.
please help thanks
robin
|
|
|
|
|
hi,
I want to read a value from a memory location of a game, but i am clueless to how i can do this, any help would be appreciated!
-- modified at 17:26 Sunday 19th March, 2006
|
|
|
|
|
See this[^] article for an example of how to read the memory of another process.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|