DBGrid And Error Data Conversion
Hi,
I use dbgrid with num value. When I wont to delete value one cell and change de active cell, I receive an eroor like "Error data conversion"
But...When I put the break point in my code (in this sub) --------------------- Private Sub DBGrid1_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = 46 Or KeyCode = 8 Then ' the 46 = delete and 8 = backspace DBGrid1.Text = Null Else
End If End Sub --------------------
And after that I change the active cell and I don't receive the error.
But I don't want to run my programme all the time with a break point.
Some body can help me?
Thanks
Régis
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Data Type Conversion Error. (Error 3421)
hi!! last time i had a problem this forum helped me a lot, so i´m here again...
See this:
Form2.Data1.DatabaseName = "passwords.xls"
Form2.Data1.RecordSource = "datos$"
Form2.Data1.Refresh
Form2.Data1.Recordset.AddNew
Form2.Data1.Recordset("Password") = p2.Text
Form2.Data1.Recordset.Update
This code gives me a 3421 error, since "p2.text" seems to have the wrong format... any ideas how i can get to run it...?
>>> thanks in advance
Data Conversion Error
DataControl (DAO) brings data from several fields into textboxes on the form. One of the fields is Number (Integer) data type. It's not Required, it's not Indexed. If it contains some value and user wants to delete that value by clearing a bound Text Box, then when the user wants to save that change by moving to the next or previous record, error saying "Data Conversion Error" occurs. Data can be deleted directly in the table with no problem.
What I'm missing? What should I do in order to allow the user to update existing value to Null?
This is an existing application, so altering it by replacing DataControl with Recordset is not acceptable (too much work related to replacing many other controls getting data from DataControl)
Thank you
Vlad
Data Type Conversion Error
Im getting runtime error 3421 "Data type conversion error", whilst executing this bit of code in Access 2000:
Dim rs As ADODB.Recordset
Dim connection As New ADODB.connection
Set rs = db.OpenRecordset("SELECT [ADDRESS] FROM [UNIFORM_PROPREC1] WHERE [UNIFORM_PROPREC1].[ADDRESS] like '" & Me.txtAddress.Text & "*'", connection, adOpenKeyset, adLockOptimistic)
Me.txtADDFind.Text = rs.Fields("ADDRESS")
The ADDRESS field in UNIFORM_PROPREC1 is a text datatype as is the me.txtAddress.text.
Any ideas? Is this code just fundamentally wrong ?!
Bag
Data Type Conversion Error
Hi, I am getting a "runtime error 524, data type conversion error" on a dbcombo. This has only happened since I have loaded msoffice'97 onto my computer. I am using visual basic 5. The all the other dbcombos in my program work fine except for this particular one. The program works fine with visual basic but when I compile and test it on the same machine, It brings up this error.
Also all the dbcombos are linked to 2 tables, 1 to populate the combo and the other is where the value is stored. It is only on the first field in the table where the problem is.
Also It is asking me for a dependency file for dblist32.ocx. Whould this be the problem as I can't find one.?
Can someone help me.
Data Type Conversion Error
i'm getting a data type conversion error with this code...can someone help?
Code:
With rstInfo
If .RecordCount = 0 Then
txtfname.SetFocus
Exit Sub
End If
Dim Counter As Integer
Counter = 0
.MoveFirst
.OpenRecordset ("select * from repairtable where custfName = " & "'" & lstlookup.SelectedItem.Text & "'")
Call update_form
End With
this code is inside a lst double click event. the update form just puts the text from the table to the textboxes. On debug the code lights up...
.OpenRecordset ("select * from repairtable where custfName = " & "'" & lstlookup.SelectedItem.Text & "'")
Data Type Conversion Error
i'm getting the error on this code
VB Code:
With rstInfo If .RecordCount = 0 Then txtfname.SetFocus Exit Sub End If Dim Counter As Integer Counter = 0 .MoveFirst .OpenRecordset ("select * from repairtable where custfName = " & "'" & lstlookup.SelectedItem.Text & "'") Call update_form End With
the error seems to be with this code...
VB Code:
.OpenRecordset ("select * from repairtable where custfName = " & "'" & lstlookup.SelectedItem.Text & "'")
Data Type Conversion Error?
Why do I get this error.
It happens when I click the arrow on the data1. And when I click break on all errors it doesnt break. It just says datatype conversion error. And it doesnt tell me what line the error is. Here is all of my code:
VB Code:
Option Explicit Private Sub Command1_Click()Text5.Text = Val(Text5.Text) + 1Text3.SelText = Date & ", "Text8.Text = Date & ", "End Sub Private Sub Command2_Click()On Error GoTo errorhandler Me.Data1.Recordset.FindFirst "[ID] = """ + Text7 + """""" Text1 = rs("ID") Text2 = rs("Student") Text3 = rs("All Lunch Detentions") Text4 = rs("Home Room") Text5 = rs("# Of Detentions") Text6 = rs("Home Phone") Text8 = rs("Detention Date") rs.Close cn.CloseExit Suberrorhandler:MsgBox "Student not found according to search criteria.", vbInformation, "Invalid Search Criteria"End SubPrivate Sub Form_Load()Data1.DatabaseName = App.Path & "ld(converted).mdb"End Sub Private Sub mnuexit_Click()Unload MefrmDataBaseViewer.ShowEnd Sub
Data Type Conversion Error
Hi,
I have a date/Time field (Required = No) in my database. Whenever I try to update this field with an empty value, an error message say "Data type conversion error" appears.
Table.Addnew
Table!Date = "" <---------------------
Table.Update
Table.Close
Can anyone help me to resolve this problem?
Thank you very much.
Data Type Conversion Error In ComboBox
Hey there,
I have a combobox in my form that is connected with a field in a table. Then everytime there is a movement in the DBGrid1 (also connected to the table), I tell the program that it has to change the combobox content. I do that because sometimes the field connected to combobox have nothing and it's a manner to force a default value to this field, when user is navegating through the table. What I mean is, if the field is empty, the first time someone pass by that record the value of the field will be setted to 1 (default). Well, this is my idea, but I can't do that because whenever there is a movement in the DBGrid1, VB returns a "Data Type Conversion error".
Let's see the facts:
The combobox info (properties window):
Name = cmbCliTipo
Datafield = clitipo
Datasource = cliente
Itemdata = 0 1 2 (one on another)
List = Loja Vendedor Crédito (one on another)
The field clitipo is an integer.
My code is:
Code:
Private Sub DBGrid1_rowcolchange(LastRow As Variant, ByVal LastCol As Integer)
If Cliente.Recordset.CliTipo = 0 Then
cmbCliTipo.ListIndex = 0
ElseIf Cliente.Recordset.CliTipo = 1 Then
cmbCliTipo.ListIndex = 1
ElseIf Cliente.Recordset.CliTipo = 2 Then
cmbCliTipo.ListIndex = 2
Else
cmbCliTipo.ListIndex = 0
End If
End Sub
I would be very grateful if someone can help me to know what's wrong. I know it's a stupid question, but, in fact, believe it or not, I have the VB 6 Little Black Book (Steven Holzner) and I have browsing through the net and I have not found anywhere a combobox setting cakewalk...
Thanks in advance!
3421: Data Type Conversion Error
Hi all,
I have database related problem. I make a access database password protected. I am trying to access the database. But I am getting the error,
Run-time error 3421
Data typeconversion error.
Following is my code.
[vb code]
Dim I As Long
Set myset = OpenDatabase(App.Path & "mydata.mdb", "ffshh84151561yuy").OpenRecordset("mytable", dbOpenDynaset)
If myset.RecordCount <> 0 Then
myset.MoveFirst
For I = 0 To myset.RecordCount - 1
display
Next
Else
Clear
End If
[vb code]
Please help me to cope up with the situation.
***RESOLVED*** Data Type Conversion Error
I need to be able to divide two currency values in an MSFlexGrid to come up with a percent value.
The challenge is that I need to have error handling to be sure that if the user puts in a $.0 currency value I do not get an error.
Ex.
Private Sub MSFlexGrid1_LeaveCell()
With MSFlexGrid1
.TextMatrix(1, 1) = Format(.TextMatrix(2, 1) / .TextMatrix(3, 1), "0.0%")
End With
End Sub
SQL Error: Char Data Type Conversion To Datetime Data Type Error
I created an application which, in one instance, queries an
SQL Server 7 table based on a date entered.
I have installed it on 4 machines (one NT, two 98 & one 95).
It works fine on all but one of the 98 machines.
On this !one! machine I receive the following error:
Error 2147217913 was generated by Microsoft OLE DB provider
for SQL Server The conversion of a char data type to a
datetime data type resulted in an out-of-range datetime
value.
I get the date from a datepicker with the format
"dd/MMM/yyy HH:mm:ss"
Help!
Thanks in advance
Need Response ASAP! Data Type Conversion Error
Our requirement is: User should be able to enter the no value in the datetime field in our case
it is time in the format HH:MM hours:minutes and still the database should store that value as
blank and no other value not even as 0:00.
In MS-Access 97 SR-2 we have table 'T' with datetime datatype field 'F'. We have a query 'Q'
defined on this table to insert record into this table 'T'. We are executing this query 'Q' from
Visual Basic 6.0 and our application requirement is such that user may sometimes not enter any
value in the date field and still the insert query should work.
Here is my query in MS-Access:
Select query:
--------------
SELECT reptime
FROM table1
WHERE id=8;
Insert query:
-------------
PARAMETERS preptime DateTime;
INSERT INTO table1 ( reptime )
SELECT preptime;
Here is my Table definition:
Name:table1
Fields Datatype
idAutonumber
reptimedate/time (short time format)
Here is the code from Visual Basic which gives error as "Data type conversion error":
Private Sub Command1_Click()
Dim db As Database
Dim qd As QueryDef
Dim rs As Recordset
Set db = OpenDatabase("d:personalira.mdb")
Set rs = db.OpenRecordset("table1")
Set qd = db.QueryDefs("insert")
With qd
.Parameters("Preptime") = vbNull
.Execute
End With
Set qd = db.QueryDefs("select")
Set rs = db.OpenRecordset("select")
'rs!RepTime = MaskEdBox1.Text
Text1.Text = rs!RepTime
'rs.Update
End Sub
Problem: When we are exceuting this query using QueryDef from VB application we are getting "data
type conversion error" message. When we did little investigation we found that, when VB is trying
to send some empty string to this date field in MS-Access Database doesn't accept any empty
string.
Here are the options I have tried?
1. When I tried to pass a Null value to the date field in the database when there is no value
entered in this date form variable. MS-Access table is storing that date value as 0:00 which is
no good because user treats it as valid time value.
2. When I tried to execute the query inside the MS-access by passing no value to this date value
it was accepting and the date value is stored as blank but same is not true when I am trying to
sent the blank date value from VB.
Is there any solution for this?
DBGrid, Bound Data, Moving Rows Does Not Update Data Proper
I am using the standard data control along with a DBgrid, I also have text boxes with some of the same data as the dbgrid.
I have the DBGrid and the recordset that populates the DBGrid
and the text boxes bound.
When I change rows in the dbgrid the data changes in the text boxes as I expected but I am also doing a "record number of number of records".
As well as some other stuff similar to the record counts.
Anyway all the text boxes update when I change rows in the DBGrid
but the other stuff does not update proper.
Strange though if I click on say the third line down on the dbgrid
everything updates but the record counter. Then if I click on say the
fifth line down the text boxes update with the correct data but the
record counter will then say record 3 of xx records. Then if I click on
say the 1st line everything updates proper except the record counter.
It will now say record 5 of xx records. Well by now you get the picture the other stuff lags behind by one row click.
I have tried
Private Sub DBgrid1_click()
data.recordset.refresh
End Sub
I also tried
Private Sub DBgrid1_click()
data.recordset.movenext
data.recordset.moveprevious
End Sub
Still doesn't work?????????
Any suggestion would be helpful.
Accessing Data Using Oracle Data Control And True DBGrid
Hi
I am using Oracle Data Control for accessing data and True DB Grid for displaying that data.
Oracle data control retrives data correctly but data is not displayed in grid. It shows number of empty rows.
Thanks in advance
Regards,
Abhijeet
How To Retrieve Ms Excell Data (sheet Name) To Sql Table Using Vb (Data Conversion)
hi
i have problem to retrieve a ms excell data to sql table (i'am using sql 2000) using visual basic.
then another problem is after the conversion process, how to retrieve the certain sql field (example name field) and
make it into shortname (example robert joseph to robert) without adding the last name and update it into sql table.
my limitation for the shortname is 12 character.
plss help me
Data In A DBGrid
Is it possible to have each cell of a DBGrid, display speciific info. I have tables (paradox) that contain the data, but it isn't structured in true database form, but they do conatin all of the data. Is it possible to programmatically define the cell of the table that I want to appear in a given cell within the DBGrid. If not, is there a better way to do this?
DBGrid Error
I use Adodc(connection String(ODBC)), DBGrid and ADODB.Stream object to save retrieve and delete data from SQL Database but i always get one error message when i do one of this.
The error is from the DBGrid and it's something (bacause it's not in english) like this this:"The function of too many steps has caused problems. Check the value for each status(state)"
Saving retrieving and deleting works fine but i always get this message. Even when i press the next button from the Adodc conrtol to move one picture down in the DBGrid, but i only get it once.
Any idea why i get this error???
Thank's!
DBGrid Error
Hi, I am having a problem with my data grid. It’s not a simple error, but it is shutting down the application, and VB if I was debugging, I try t debug, but nothing wrong in the code. And it’s not a standard one, which means it doesn’t appear always. I am calling a form with a datagrid in it from inside another datagrid. I am getting the following message:
This Program has performed an illegal operation and will be shut down.
If the problem persists, contact the program vendor.
VB6 caused an invalid page fault in module DBGRID32.OCX at 017f: 230fc8b0.
Registers:
EAX=00000000 CS=017f EIP=230fc8b0 EFLGS=00010216
EBX=00000100 SS=0187 ESP=007fef60 EBP=00000808
ECX=007fefa8 DS=0187 ESI=03accdc0 FS=32ff
EDX=03ace020 ES=0187 EDI=03accce8 GS=0000
Bytes at CS: EIP:
8b 97 e4 00 00 00 8d 7c 24 08 c1 ea 01 8b 0f 80
Stack dump:
03acd254 03accce8 00000000 00000000 00000000 00000000 23111ef9 00000100 007fefdc 007fefac 007fefa8 007fefec 007fefd4 00008044 007ff020 c1500001
Some times when I say close, it gives me the message above once more, and re close, other times it gives me the following message, and don’t close at all till I cut the power of the PC.
This Program has performed an illegal operation and will be shut down.
If the problem persists, contact the program vendor.
VB6 caused an invalid page fault in module KERNEL32.DLL at 017f:bff9dc5d.
Registers:
EAX=c00301a8 CS=017f EIP=bff9dc5d EFLGS=00010212
EBX=007ffe28 SS=0187 ESP=006fff7c EBP=00700218
ECX=00000000 DS=0187 ESI=00000000 FS=32ff
EDX=bff76855 ES=0187 EDI=bff79198 GS=0000
Bytes at CS: EIP:
53 8b 15 54 ad fc bf 56 89 4d e4 57 89 4d dc 89
Stack dump:
So what Do you think, is it a DBGrid32 problem, or a problem with coding in someway? Please help me it’s very urgent.
Dbgrid Error
Hi, I am having a problem with my data grid. It’s not a simple error, but it is shutting down the application, and VB if I was debugging, I try t debug, but nothing wrong in the code. And it’s not a standard one, which means it doesn’t appear always. I am calling a form with a datagrid in it from inside another datagrid. I am getting the following message:
This Program has performed an illegal operation and will be shut down.
If the problem persists, contact the program vendor.
VB6 caused an invalid page fault in module DBGRID32.OCX at 017f: 230fc8b0.
Registers:
EAX=00000000 CS=017f EIP=230fc8b0 EFLGS=00010216
EBX=00000100 SS=0187 ESP=007fef60 EBP=00000808
ECX=007fefa8 DS=0187 ESI=03accdc0 FS=32ff
EDX=03ace020 ES=0187 EDI=03accce8 GS=0000
Bytes at CS: EIP:
8b 97 e4 00 00 00 8d 7c 24 08 c1 ea 01 8b 0f 80
Stack dump:
03acd254 03accce8 00000000 00000000 00000000 00000000 23111ef9 00000100 007fefdc 007fefac 007fefa8 007fefec 007fefd4 00008044 007ff020 c1500001
Some times when I say close, it gives me the message above once more, and re close, other times it gives me the following message, and don’t close at all till I cut the power of the PC.
This Program has performed an illegal operation and will be shut down.
If the problem persists, contact the program vendor.
VB6 caused an invalid page fault in module KERNEL32.DLL at 017f:bff9dc5d.
Registers:
EAX=c00301a8 CS=017f EIP=bff9dc5d EFLGS=00010212
EBX=007ffe28 SS=0187 ESP=006fff7c EBP=00700218
ECX=00000000 DS=0187 ESI=00000000 FS=32ff
EDX=bff76855 ES=0187 EDI=bff79198 GS=0000
Bytes at CS: EIP:
53 8b 15 54 ad fc bf 56 89 4d e4 57 89 4d dc 89
Stack dump:
So what Do you think, is it a DBGrid32 problem, or a problem with coding in someway? Please help me it’s very urgent.
**** DBGrid Error
hey
i created a data grid control DBGrid1 and now want that it shld display the records that r ther in the recordset so this is what i hav done,
Private rs As ADODB.Recordset
Private Sub Form_Load()
Set rs = New ADODB.Recordset
rs.Open "select * from Surveyor", Conn, adOpenDynamic, adLockReadOnly
Set DBGrid1.DataSource = rs
End Sub
but this " Set DBGrid1.DataSource = rs " line gets highlighted and an error message is shown sayin "class does not support automation or does not support the expected interface"
HELP ME
Edited by - svaibhav on 3/8/2005 4:20:13 AM
Data Report And DBGrid
Hi,
I need an information how to link my DBGrid to a Data Report.
I am using Data Enviroment for a data report with a DAO connection, and a MS Access database. On a form, I have a search button which sends the results of query to the DBGrid. Now, I would like to print those results on a Data Report (or if there is a way to print results from the DBGrid, that would work too).
Regards.
Sorting Data In A Dbgrid
does anyone know how to sort data in a dbgrid like in access, like the A to Z function but using criteria like Rank ie Sgt Cpl LCpl Pte that sort of thing?
thanks
Spud
Data To DBgrid Refresh
Hi,
can anybody assist me in how I can re-populate a DBgrid that is tied to a data control when I give the data control a new SELECT FROM statement. When the form loads it loads ALL RECORDS INTO THE DBgrid, what I want to do is change some parameters (dates) with combo boxes and re-populate the DBgrid. I have tried lots of different ways of achieving this but none of them will work. My code is available if required.
wijnendael
Reading Data From A DBGrid
Hi,
How do i read data from a DBGrid (see the screenshot) ?
I want to create a kinda report thing that i can print out and how i am going to do it is with a
borderless form and multiline textbox then frm1.printform.
So what i want to do is read the records from the dbgrid into txtRota.text
eg
frmRota.txtRota.text = dont know what goes next ......
Thanks for any help
- Chris
EDIT, one more thing, how do you properly close forms, frm.Hide ?
Edited by - chrisgill369 on 1/31/2005 1:07:51 AM
Exporting Data From DBGrid
Is there a way to export selected data from a DBGrid (ADO or non ADO) into a label/textbox so that selected database items could be printed or viewed in that particular way? I have searched the same question beforehand but have had no luck... thanks in advance
Edited by - fuz on 12/1/2004 1:35:09 PM
Help With Dbgrid! Select Data From It!
Hello everyone... This is my problem:
I have a dbgrid, connected with data normal datacontrols... it´s connected with an MS access database... So the problem I have is that I dont know how to take certain data from the grid and then place it on a textbox. For example I highlight the third row on the grid, and I have a button, When I press that button I want that data displayed on textboxes... How can I do that? I´m a newbie!
How Am I Able To Input Data To DBGrid
Hi,
Current I have an array of data. I need to place the data to the DBGrid. But I do not know how it can be do so. Would you mind explain how it can be done so. Is there any Edit, Update properties I can used to add data to the datagrid?
Thanks for your help !
Regards Vivien
Process Data Thru Dbgrid
hi
Guide to me about DBgrid or msflexgrid to process the data in VB.
In dbgrid we enter the no in first cell according to this following cells are filled from table.
Pls help in this aspect how to rectify the problemm
tks..raja
DBGrid Data2 Error 424
I've done this one time before but can't make this one work.
After placing my grid on the form, I just put Data2 in the Source field in the properties of the DBGrid.
Code:
Private Sub Form_Load()
Dim DB As Database
Dim RS As Recordset
Dim QRY As String
QRY = "Select * From Names Where Surname like 'smith'"
Set DB = OpenDatabase("d: vr
ames.mdb", False, True)
Set RS = DB.OpenRecordset(QRY$, dbOpenDynaset)
RS.MoveLast
Set Data2.Recordset = RS
Data2.RecordSource = QRY
Data2.Refresh
End Sub
I receive a error 424-Object required at Set Data2.Recordset = True.
I have the same references as those in my working program and in the same order.
Right clicking the DBGrid - I cannot retrieve the fields.
It's gotta be something simple...
Data Conversion
Well, our company had to contract some work out to a java developer for a Cell phone app that returns to our server the Latitude, longitude and Time that the data was taken from the phone. the Cell the sends the data to our server & we plot the coordinates.
The cell is supposed to return this:
1st 8 bytes (Latitude)
2nd 8 bytes (longitude)
3rd 8 bytes (Timestamp)
anyways, I’ve fiddled with the data and can't get the date of ~05/10/04 11:27 PM~
and yet alone the Lat. & long. cords that are approximately around where the Cell was.
Any help (w/ code snippets) would be great.
Bellow is the asc value of the data, separated by a comma.
0,0,0,0 14,46,158,0 255,255,255,255 218,107,65,128 0,0,0,252 110,226,73,180
just so we are looking at the same data here is some code
Code:
Dim iStr As String * 24
Dim i&, iArray$()
iArray = Split("0,0,0,0,14,46,158,0,255,255,255,255,218,107,65,128,0,0,0,252,110,226,73,180", ",")
For i = LBound(iArray) To UBound(iArray)
Mid(iStr, i + 1, 1) = Chr(iArray(i))
Next
Open "C:GPSData.dat" For Binary As FreeFile
Put #(FreeFile - 1), , iStr$
Close #(FreeFile - 1)
Debug.Print iStr$
Data Conversion
Hi,
dose anyone know how to resolve in crystal an of the bugs.
I am conected to multiple tables via ODBC.
in crystal reports i did use the visual data manager to creat the relationships. and the fields are there. so far all this is working.
the problem is i have in two diferent tables fields with the same name but diferent data. and the one is the data on which the criteria is filtering. as i hav it right now the data from the primary field is shoving instat of the data from the field if i brows the data it shows the corect one.
Data Conversion
Hi,
dose anyone know how to resolve in crystal an of the bugs.
I am conected to multiple tables via ODBC.
in crystal reports i did use the visual data manager to creat the relationships. and the fields are there. so far all this is working.
the problem is i have in two diferent tables fields with the same name but diferent data. and the one is the data on which the criteria is filtering. as i hav it right now the data from the primary field is shoving instat of the data from the field if i brows the data it shows the corect one.
Data Conversion
HI All
Does any one know how to convert a binary file into a readable (by human)
file? Its from a bin file, has addresses and stuff which I can work out...
but how do you do the actual conversion?
--
Regards
Dillon Mantle
Different Angle Solutions
072 300 0206
Conversion Error
Hi,
I get the following error message:
"Conversion error occurred while building parameterized update or refresh statement."
when I use the UpdateBatch ADO method. Has anyone faced this error message before? Please help!!!
Thanks, Lior
How To Populate DBGrid With Out Using Any Data Controls
hello,
My requirement is to populate DBGrid without using data controls.Using adodb.recordset following is the statement i had used to populate DBGrid but values r not getting displayed in the grid.
dim cn_path as new adodb.connection
dim rs as new adodb.recordset
Dim strsql As String
On Error Resume Next
rs.CursorLocation = adUseClient
Cn_path.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "dbHRMS.mdb" & ""
Cn_path.Open
strsql = "select empid,empname from Leave_OB"
rs.Open strsql, Cn_path, adOpenDynamic
DBGrid1.DataSource = rs 'data not getting assigned to dbgrid
'giving error object required
End If
Set rs = Nothing
Set Cn_path = Nothing
thanks in advance
karuna
Viewing Excel Data In A DBGrid
I am trying to display Excel Data in a DBGrid and have not been able.
Using
MDAC 2.8
VB 6 SP5
WIN2000 SP4
I can examine the data Ok writing it to a Text box moving thru it with DataRst.MoveNext
So I have A Good Connection
But I can't get it to display in a DBGrid.
This is the code I am Using:
(General)
Dim cn As ADODB.Connection
Dim DataRst As ADODB.Recordset
Private Sub Form_Load()
Set cn = New ADODB.Connection
With cn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source=D:Junk2CitibankTestXLSTest2.xls;" & _
"Extended Properties=Excel 8.0;Persist Security Info=False"
'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:Junk2CitibankTestXLSTest2.xls;Extended Properties=Excel 8.0;Persist Security Info=False
.Open
End With
Set DataRst = New ADODB.Recordset
strQuery = "SELECT * FROM [Sheet1$]"
DataRst.Open strQuery, cn, adOpenStatic
Set Me.DataGrid1.DataSource = DataRst
Printing/Deleting The Data In A Dbgrid?
hi i was wondering if anyone could tell me how to delte the data in a dbgrid, i have created an sql search where the data in the search is displayed in a dbgrid and need some code that will cause the data in the grid to print or be deleted,
thanks
Importing Data From .dbf File To Dbgrid
I have a .dbf file that I would like to add to a grid. I am not sure how to do this. I have tried to set it up with ADODC control but can't get it to work.
Thanks.
Visual Basic 6.0 Dbgrid, Data
Normally I use the dbgrid assocciating it a database for example I display the custormer that have balance greater 1000. I specify the atributes of database, but now I want read from any database and I want write information in dbgrid but no associating a database specify.
Please help me.
Dbgrid Data Entry Validation
Hey all,
How can i make sure that what the user enters is correct!
For example:
I have in the grid on it's button click event it shows a combo box. I want to make sure that if they manually enter data into that column that it's correct or stop them from manually entering data without selecting it from the combo box.
if that doesnt make sense please tell me?
thanks
DBGrid Not Refreshing When Recordset Data Changes
I have a DBGrid bound to a recordset in a Data Enviroment. When I change the data in the recordset by issuing a new sql statement the data in the recordset changes but the grid still shows the old data.
I have tried setting the grid.datasource to nothing and then setting the grid.datasource to the data enviroment recordset but then nothing shows up in the grid. I've also tried using the grid.rebind and grid.refresh and nothing seems to work.
The only way I've got it to work is to close the form that has the grid on it and then reopen it. However, I want to keep the form open and the data in the grid would change with changes in the recordset.
Any suggestions?
DBGrid - Data Control Question
Dear all,
At the moment I'm usind DAO 3.6 and I'm using a Data control and a dbgrid control to display the results, and as you are ware the dbgrid gets the recoursource based of the data control "data1" Data control. But that does not work if I try to connect to a odbc database, any ideias, any examples?
I was tkinging that instead of basing the dbgrid in my data1 create my connection via code........
I NNNNNEed help please..I'm lost
Many thanks
VB6 - DBGrid- How Transfer Data To MSAccess
Hello All
I did a program made on VB6 who reads tables from the MS Acess to DBGrid.
It works well, no problem at all.
My question is: Can I write data on the lines of the DBGris and transfer
this data into the table on MsAccess?.
If the answer is YES , could you give-me any information about it (the code)
or where I can obtain that information on the Internet.
Thks
David
Add, Update And Delete Data In DBGrid
I am trying to use the DBGrid that comes with VB6 to Add, Updat or delete data from an underlying ACCESS2000 database. I have master/detail relationship in the undrlying table. The detai can return more than one record. I want the user to be able t add, delete or update the underlying detail without adding updating or deleting the master. I have already tried usin AllowAddNew (True), AllowDelete (True) and AllowUpdate (True and it doesn't work. I want to add 3 command buttons for ADD DELETE and UPDATE and have the code that will allow thes operations to take place.
I will appreciate any help out there.
Thanks
M. Hussaini
VB5: DAO-DbGrid Data Bindings Across Forms Possible?
Hi,
I hope I phrased this post correctly, possibly not!
Currently I have a dBGrid object which is data bound to a DAO recordset on the same form. The recordset datMembers' is linked to 'tblMembers' in the back end MSAccess98 database using a 'Dynaset' type recordset. All works fine!
However, I have tried unsuccessfully to make my solution more elegant placing a dBGrid on a second form specifically to view user details in a 'broadsheet' format thus de-cluttering the calling form. The DBGrid on the second form therefore needs to be 'data-bound' to the DAO on the calling form.
So I suppose I am looking for data-bindings across form objects. Can this be done?. I have tried unsuccessfully using several approaches - using the grids datasource property and attempting to link the DBGrid from the calling form. I cant find anything in my Wrox VB6 Programming book (My Bible!) or other published sources which help on this issue; they all focus on data linking DAO/ADO recordsets to display objects - on the same form!
This type of functionality is common with many applications when related sub-windows are brought up modally, but the technique eludes me at present.
Thanks in anticipation of advice
|