Filling A ComboBox With Data From A MySQL DB
Hi, I have a few fixed Values stored in a Table in a MySQL DB and would like to show these in the Dropdown part of the ComboBox i.e. use it as a DropDown List. How do I make the connection between the box and my data. I'd be grateful for any suggestions. Thanks Chris
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Filling A ComboBox Depending On Another ComboBox
Hi,
I want to fill a Combobox (cmb2) dependent on what the user has chosen in a first ComboBox (cmb1).
The first combobox ist based on a table, and the second combobox shall be filled with lines from another table, where only the lines are chosen that are relevant, fx:
table for cmb1:
A
B
C
D
Table fro where you choose the rows for cmb2:
A Boston
A Washington
A Baltimore
B Chicago
B Miami
C San Francisco
D Miami
D New York
D Los Angeles
D Las vegas
If the user chooses "A" in cmb1, in cmb2 shuld there so be only rows from the second table, where the first column is A.
Is there anybody out there who knows a solution?
Thank you very much!!
Filling A Dynamic Array Then Filling A Combobox With The Array
Hello all,
Forgive me, my VB is a bit rusty , but I need to create a dynamic array from an excel spreadsheet. The array will hold data from an unknown # of rows but only 3 columns (Player #, Player Name, Position). Then once the array is filled it is loaded into a combobox on the sheet.
Thanks for all the help in advance, SPC
Filling A Combobox
I have a combo box that I fill with a recordset. The problem I am having is that it is getting to be too slow as it is entering 36,000 items at runtime. Is there a faster way to fill up the combo box other than looping through a recordset and using .additem??
Filling A ComboBox
I'm trying to fill a combo box with 1500 values , as fast as humanly possible.
Using a basic loop it still takes ages.
does anybody have an idea of how a data bound control could be used here??
I have bound a combo box to a data environment command , but it only seems to fill the combo box with the first value of the recordset .
If anyone has any ideas , please please send them on!.
Filling ComboBox
Hi
I am using regular combobox and want to add more than ten thousand records in combo box from recordset.
My code
do while not rs.eof
combo1.additem rs.fields(0)
rs.movenext
loop
But this is taking long time to add records to combo box.
Can any one suggest me the fastest way to add value to combobox.
Object {filling Combobox With Them}
In VB when we type
'dim a as' a dropdown list appears with all the different objects.
I am doing a addin and would like to populate my combo box with that list. Can anyone pls help.
thanks and regards
Filling A ComboBox From A .db File!
Hi all! I'm fairly new at Visual Basic (using 6.0), and I am working on a small application. I've copied some code elsewhere to save 2 entries from a form (TextBox and OptionButton) into a .db file, using a | delimiter. However, I need to be able to retrieve these two entries, but in a unique way.
The database looks like this:
verbatimA|0.5
verbatimB|1
verbatimC|0.5
verbatimD|0.5
etc...
Now, what I want to do is create a procedure that will (at runtime) pull the "verbatim" entries and fill them into a ComboBox. The numerical entries, however, need to be on "standby", or even hidden...but they do need to be loaded as well. Here's how they work.
TextBox1 (example) will hold numerical user data (separate database I will do later on). This data will be modified when elements of the ComboBox are selected, via simple addition. For example, if I click on verbatimA in the ComboBox, and the user's data is 4 in TextBox1, I want it to change it to 4.5. This change mustl not save unless the Update button is pushed.
I was told it needed to be done via arrays, but I'm not versed well enough in arrays to do something this complex, at least complex for me. The current code to save the file is using TextStream (snippet shown below). Is there any comparable method to do this using the same type of code (TextStream)? It would help me learn this a lot better, instead of using SQL or other methods. Here's the code snippet:
Some variable names:
ZoneData = .db file
PointValue = numerical value of an OptionButton array (10 values, in increments of .5 from 0.5 - 5.0)
Code:
Private Sub WriteToZoneFile()
On Error GoTo errmsg
Dim ts As TextStream
Dim ZoneDataLine As String
Set ts = fs.OpenTextFile(ZoneData, ForAppending)
ZoneDataLine = Me.txtNewZoneName + "|"
ZoneDataLine = ZoneDataLine + CStr(PointValue)
ts.WriteLine ZoneDataLine
ts.Close
MsgBox "New zone added successfully.", vbOKOnly, "New Zone Added"
Exit Sub
errmsg:
MsgBox "Error: " + Err.Description, vbCritical
End Sub
Thanks in advance!
Filling Combobox With Mysqldata
VB Code:
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim conn = New MySqlConnection() Dim myCommand As New MySqlCommand Dim myAdapter As New MySqlDataAdapter Dim myData As New DataTable Dim SQL As String SQL = "select (chrGemeenteNaam) from tblGemeente" conn.ConnectionString = "server=mysql-3.priorweb.be;" _ & "user id=***tsss***;" _ & "password=***tsss***;" _ & "database=retabo" Try conn.Open() Try myCommand.Connection = conn myCommand.CommandText = SQL myAdapter.SelectCommand = myCommand myAdapter.Fill(myData) cmbGemeente.DataSource = myData Catch myerror As MySqlException MsgBox("There was an error reading from the database: " & myerror.Message) End Try Catch myerror As MySqlException MessageBox.Show("Error Connecting to Database: " & myerror.Message) Finally conn.Dispose() End Try End SubEnd Class
the combobox shows me: System.Data.DataRowView
i know it already had been posted here, but not for aan mysql connection. And it just don't work
greetz and thx, freakyme
[edit]sorry, posted in wrong section, can someone move it tot vb.net (i have the 2005 version) [/EDIT]
Filling ComboBox Problem
Hi All,
I am using VB 6 and have the need to fill a ComboBox list every time it gets focus, because it is filling from a common text file within a network. I fill the list within the GotFocus event and it works fine.
The problem I have is that if the first thing a user does is click on the DropDown button, what happens is the list drops down, then the ComboBox gets focus. At that point the list gets filled and the list dissappears. Thus the user has to click the DropDown button a second time to see the list. God knows why MS decided to have the DropDown event fire before the GotFocus event. If it was the other way around I wouldn't have a problem.
Does anyone have a work-around?
Thanks in advance
Alan Liddle
Filling ComboBox Problem
Hi All,
I am using VB 6 and have the need to fill a ComboBox list every time it gets focus, because it is filling from a common text file within a network. I fill the list within the GotFocus event and it works fine.
The problem I have is that if the first thing a user does is click on the DropDown button, what happens is the list drops down, then the ComboBox gets focus. At that point the list gets filled and the list dissappears. Thus the user has to click the DropDown button a second time to see the list. God knows why MS decided to have the DropDown event fire before the GotFocus event. If it was the other way around I wouldn't have a problem.
Does anyone have a work-around?
Thanks in advance
Alan Liddle
Filling In A Combobox As The User Types.
I'm trying to automatically fill in a combobox as the user types and then selecting the part that he hasn't typed himself. Like internet explorer 5 and older do when you're typing in an url.
I'm crap at explaining so I'll just post a pic... When you type the letter B this is what happens: http://warcry.homestead.com/files/prob.JPG
Now the problem is that when you type the next letter it appears behind the whole word instead of in the selected area.
Here's the code I'm using
Code:
Private Sub dbcboNaam_Change()
Dim intLengte As Integer
intLengte = Len(dbcboNaam.Text)
datSQL.RecordSource = "select * from tblBedrijven where naam like '" & dbcboNaam.Text & "%';"
datSQL.Refresh
dbcboNaam.Text = datSQL.Recordset!Naam
dbcboNaam.SelStart = intLengte
dbcboNaam.SelLength = Len(dbcboNaam.Text)
end sub
Does anyone know of a way to solve this?
Filling An Access 2000 Combobox ...
Hi there ...
I admit it, I am wrong ... There is no AddItem method to an Access 2000 ComboBox (there is for the 2002/XP version) ... That being said, what would be the best method to populate said ComboBox without binding it to a table/query? Thanks!
- Mike
Filling A ComboBox With A Recordset: Error 3265
Visual Basic Segment:
VB Code:
With rsTipModels Me.Combo_Option_Selection_Tip_Model_Type.Clear While Not .EOF MsgBox .Fields(!MODEL_NUMBER) 'A) Same Error MsgBox .Fields("MODEL_NUMBER").Value 'B) Same Error MsgBox .Fields(!MODEL_NUMBER) 'C) Same Error MsgBox .Fields("MODEL_NUMBER").Value 'D) Same Error Me.Combo_Option_Selection_Tip_Model_Type _ 'E) Same Error .AddItem .Fields("MODEL_NUMBER").Value .MoveNext Wend End With
I thought I had this figured out. Unfortuanaly, I lost the source I was using to figure it out and can't find it again.
Help!
Thanks,
Microsoft Forms 2.0 Object Library - Combobox. Filling Up Error
Hello i am trying to fill up my forms 2.0 Combo box like this
this is how i call the module code
Code:
populatemulticombo combomachinename, "SELECT * FROM tblTASKfinishingMachines ORDER by MachineName", "MachineName", "finishingMachineID", "CategoryID"
in a module
Code:
Sub populatemulticombo(ByRef cbo As ComboBox, strSQL As String, ByRef strField As String, ByRef strfield2 As String, ByRef strfield3 As String)
Dim x As Integer
x = 0
Set rs2 = New ADODB.Recordset
rs2.Open strSQL, cn, adOpenStatic, adLockReadOnly
If rs.EOF Then
Else
Do Until rs2.EOF
cbo.AddItem
cbo.List((x), 0) = rs2.Fields(strfield2)
cbo.List((x), 1) = rs2.Fields(strField)
cbo.List((x), 2) = rs2.Fields(strfield3)
x = x + 1
rs2.MoveNext
Loop
rs2.Close
Set rs2 = Nothing
End If
End Sub
if i do this out of a module, it works fine! (obviously replacing variables with actualy object names etc)
but if i have it like this, i get this horrible error "Type Mismatch" Whenever i try to run it! then it highlights the call sentence.
Please could anyone help me?! i would be very grateful as always
-stewie
Filling The Combobox List In A Farpoint Spread Sheet Dynamically
I have a spreadsheet grid that has about 2 combobox columns and a text box that shows the data in Database Table 3.
The drop down list of Combobox Column 1 is taken from Database table 1 and the drop down list of Combobox Column 2 is taken from Database table 2.
Initially on taking the dialog all the records in table 3 has to be displayed and the combo box column values of the displayed records are not to be modified.
On inserting a new record in the grid, first the Combobox Column 1 has to be selected. Based on the selection in Combobox column 1, the data in the drop down list of Combobox Column 2 should be filtered and shown to the user.
How can this be done?
I can only fill the drop down list on definition of the combobox column 2 in the grid. There seems to be no specific method for dynamic defintion of the Combobox list values
Problem While Filling Data In Data Combo At Run Time
Hi all,
Can anybody help me out in this.. Iam using the Data Combo for displaying records from a table. It works fine when i use ADODC Data Control . While i fill it up at run time i doesn't work. I have used the following code :
SQLSTR = "Select * From Category_Master"
Cat_Rst.Open SQLSTR, FA_CONN.Adocon, adOpenStatic
If Not Cat_Rst.EOF Then
With DataCategoryName
Set .RowSource = Cat_Rst
.DataField = Cat_Rst(1).Name
.BoundColumn = Cat_Rst(0).Name
End With
End If
DataCategoryName.Refresh
DataCategoryName.ReFill
Can anybody just suggest me some other alternative or give a solution in this regard.
Thanks in advance
Regards
Balaji.v
Fill A Combobox From Table In Mysql Database
Hi,
I'm sure this question has been asked before but I couldn't find an occurence of it.
I've got 2 comboboxes on a form and I'd like to fill them from a table in a mysql database. Any advice on how this should be done?
Thanks,
Mag2
Filling A Data Combo Box
Is it possible to fill a data combo box with 2 fields from the same recordst? I get one field to work fine but when I try the second I get an error message.
the code I'm trying to use (after the SQL statement and opening the recordset is:
'dcIndividual is the data combo box
'rsIndividual is ths recordset
'Name and ID are fields in the recordset
Set dcIndividual.RowSource = rsIndividual
dcIndividual.ListField = "Name" & "ID"
The error is #380 Invalid property value
About Filling The Data Into The Tables
Hi, I'm back again. Ahem, straight to the point:
1st question. In Microsoft Access (MA) of course we can just fill in the primary key fields and leave the other empty (null)
However, when I want to add records through VB codings, why it indicates that the fields must not be empty? Let me describe my problem:
Let say I have a table named Students. Below are the attributes:
Matrix Number --> matnum
Student Name --> stuname
Student GPA --> stugpa
Enough for that. Let say I want to add this record:
matnum = 12345 (primary key)
stuname = Alice
stugpa = 3.46
This my coding:
With adostudent.Recordset
.AddNew
.Fields("matnum").Value = txtmatnum.Text
.Fields("stuname").Value = txtstuname.Text
.Fields("stugpa").Value = txtstugpa.Text
.Update
End With
I'll tell u what, this coding works out prefectly. However, if I let the txtstugpa.Text empty, there will be an error message. This will not happen if I make my system using Microsoft Access.
2nd question, can we made our form in VB as easy as in MA? In MA, we have header, details, and footer. All data will be display in details section and I kept thinking whether I can do this in VB.
3rd question,
I always look at other people's coding in using adodc and always try to improve my best. I juz want to ask, does my way of SQL coding below correct enough?
adostudent.CommandType = adCmdText
adostudent.RecordSource = _
"SELECT * FROM STUDENT WHERE STUDENT.[STU_NUM] = '"& txtstunum.Text &"'"
adostudent.Refresh
Juz give me ur opinion and plz guide me the best and simplest way in starting adodcs and sql coding.
Thats all for now, hope to hear from u soon. TQ so much!
Filling FixedCols With Data
I am displaying data from a sql server 2000 db in a mshflexgrid using
Code:
Set hfgPartData.DataSource = rs
and it works fine except I want to have the first 4 columns fixed so they remain visible when scrolling. I have 4 columns fixed but they are not being populated with data. Is there something I can do at run time?
Thanks!
New To VB, Filling Data Gaps?
Hello,
I'm a proficient Excel user, but I've never used VB beyond a few automatically created Macros. What I have is a lengthy data set (actually 20 years split into multpile files) with data reported every 10 minutes. Problem is, there are gaps and extra times in the data set. So sometimes a few hours will be missing, other times data will be present in increments greater than 10 minutes. Using VB, would I be able to create a script to monitor the increment between the date/time stamp and insert blank rows of data to fill in the gaps and delete extra readings? If not, what would you recommend I use to manipulate my data (it would need to be a freeware program)?
Thanks for any help,
Matt
Filling Combox With Xml Data On The Fly
<CROSS POSTED>
Hi Experts,
I can not solve the following problem. I have looked and searched the internet but have to found a good solution yet. My problem is the following.
I have an simple xml file with one node and several dataentries. What I want is on click on the combobox it has to populate the combobox with data from the xml file. Nothing more nothing less. I can manage this with an ini file or with an recordset but with an xml file I cannot get it right. I do not like the solution to first read the xml file, convert it into a recordset and then in a combobox.
Anyone who can help me
Thanks,
Vreuls
Filling Template With Data From MS Access
Hi all!
Perhaps somebody could help me:
I have MS Access database with some data for webpages (title, keywords, content & etc) and template file (html).
So, for each record of DB table I need to create webpage containing corresponding data.
Is there any way to open that template and replace variables with data from the table using VB script?
Filling ListView With Data From A Database
I'm trying to fill a ListView control with data from one of my databases. I'm using Access 97 with an ADO connection, not DAO. I have tried but haven't figured out how to fill the ListView control with recordset data. I haven't ever really used a ListView control ever I usually use TrueDBGrid but that will not work in my current application I'm building. Anyway here is my code to hit and open/close the recordset:
Dim bSetNo1 as Byte
Dim gtSQLStmt as String
gtSQLStmt = "SELECT * FROM Table" & _
" WHERE index_num = '" & txtIndexNum & "'"
open_recordset_sub gtSQLStmt, bSetNo1
If adoRec(bSetNo1).RecordCount Then
'Code usally goes here
End If
close_recordset_sub bSetNo1
Can anyone help?
Problem In Filling Grid Data
Hi All,
I am having a TDBGrid with 5 columns, which are in hierarchy.
1st column----Group contains
2nd column----Division contains
3rd column-----SubDiv contains
4th column-----SubdivFamily Contains
5th column-----familyLine
Now my problem is like in TDBGrid if I fill the 5th column then the previous 4 columns should automatically be filled using the hierarchy or if i fill the 3rd column then previous 2 should automatically be filled. I am able to fill just the previous column using AfterColUpdate event of grid, in which I am writing the sql for filling the previous column data.
Now when I write the sql for the rest of the columns then it does not take that.
example: my grid looks like below
-------------------------------------------------------
| Grp1 | Div1 | sdiv1 | | |
-------------------------------------------------------
| | Div2 | sdiv2 | | |
--------------------------------------------------------
Now when i fill only Sdiv1 then i am able to fill div1 and grp1.
the selects used by me are :
VB Code:
If (Len(tdbPrdtCritSumry.Columns(1).Value) < 1) And ColIndex = 2 Then TempSelectStmt = "select product_division__code FROM product_pnl_family where code='" & tdbPrdtCritSumry.Columns(2).Value & "'" llNumRows = GetValidValues(ByVal TempSelectStmt, Me, 1) datVE.Refresh tdbPrdtCritSumry.Columns(1).Value = datVE.Recordset.Fields(0) datPrdtCrit.Refresh If (Len(tdbPrdtCritSumry.Columns(0).Value) < 1) And ColIndex = 2 Then TempSelectStmt = "select product_group__code FROM product_division where code='" & tdbPrdtCritSumry.Columns(1).Value & "'" llNumRows = GetValidValues(ByVal TempSelectStmt, Me, 1) datVE.Refresh tdbPrdtCritSumry.Columns(0).Value = datVE.Recordset.Fields(0) datPrdtCrit.Refresh End If End If
But when i fill sdiv2 then it only fills div2 and it takes the previous value Grp1 for tdbPrdtCritSumry.Columns(0).Value thats why it doesnt execute the second if in above condition. can anybody help me in this.
Thnx,
sanjeev
How To Append Listview Data Filling
Hi all. coiuld any one show me how to append data fillling to listview. I am using this 2 code but each time they run they over write existing data in listview. I want the data to be written to the end of listview row and keep the existing data. Is there any option in listview that keeps old data and add new data to end of its row?Thanks
VB Code:
Private Sub Command15_Click()For i = 1 To List2.ListCount'For i = 1 To ListView1.ListItems.Count ListView1.ListItems(i).SubItems(2) = List5.List(0) ListView1.ListItems(i).SubItems(3) = List4.List(0)Next i End Sub
VB Code:
Private Sub Command22_Click() For i = 1 To List2.ListCount ListView1.ListItems(i).SubItems(1) = List3.List(i - 1) 'ListView1.ListItems(i).SubItems(5) = List4.List(i - 1)Next i End Sub
Filling Data Combo At Run Time
Hi,
I'm trying to fill a data combo at run time by opening a recordset depending on the value selected in another data combo.
For example, when the user selects a customer name from the first data combo, the order nunbers of only this customer must appear in the second.
When i try this, i'm not able to set the bound column to the second data combo. This changes to the bound text instead of the set value.
what could be the reason?
Thanks in advance.
Filling & Retreaving Data From Website With VB
When I print an envelope, I would like my Access database to automatically fill in the address information into the web form at
URL and receive the standard address with zip+4.
Can someone show me how to call up the web page, get the info into the page and retrieve the results using VB?
TIA
Filling Flexgrid With Data From Database In Vb.net
hello.
i would like to add a ms flexgrid in my project and want to get it filled with data from the database. i have tried to do this with adodc cintrol but .net is not supporting it . It does not display adodc in the data siurce property of the grid. kindly help me out with this problem as my project is specifically based on the grid operations.
regards,
mansoor sheraz
Automatic Form Filling With Table Data
Hi All,
I am using MS access to build form. In that form I am creating a button in it. When I click that button I need to open a new form and fill that form fields with MS access table data. Can you please send me the code how to do this?
THanks,
Sridhar!!
Filling Text Boxes On Form2 With The Data From Form1
Hi All,
When I click on a item in my list I fill the text box's below with the data, but now I have moved those text boxes to form 2 how can I get it so that when I select an item from a list and hit my button the data will now be sent to the text fields in form2.
I have this is form2 load event but it keeps coming with the error can't find project or libaray and points to the List1.Listcount method.
[vbcode]
Adodc1.Recordset.MoveFirst
Do While i < List1.ListCount
If List1.Selected(i) Then
Exit Do
End If
i = i + 1
Loop
Adodc1.Recordset.Find "ControllerID=" & List1.ItemData(i)
If Not Adodc1.Recordset.EOF Then
Text1 = Adodc1.Recordset!FirstName
Text2 = Adodc1.Recordset!Lastname
Text3 = Adodc1.Recordset!Address
Text4 = Adodc1.Recordset!Town
Text5 = Adodc1.Recordset!County
Text6 = Adodc1.Recordset!Postcode
Text7 = Adodc1.Recordset!Telephone
[/vbcode]
I hope someone can help?
Thanks
Loftty
Filling Text Boxes On Form2 With The Data From Form1
Hi All,
When I click on a item in my list I fill the text box's below with the data, but now I have moved those text boxes to form 2 how can I get it so that when I select an item from a list and hit my button the data will now be sent to the text fields in form2.
I have this is form2 load event but it keeps coming with the error can't find project or libaray and points to the List1.Listcount method.
VB Code:
Adodc1.Recordset.MoveFirst Do While i < List1.ListCount If List1.Selected(i) Then Exit Do End If i = i + 1 Loop Adodc1.Recordset.Find "ControllerID=" & List1.ItemData(i) If Not Adodc1.Recordset.EOF ThenText1 = Adodc1.Recordset!FirstName Text2 = Adodc1.Recordset!Lastname Text3 = Adodc1.Recordset!Address Text4 = Adodc1.Recordset!Town Text5 = Adodc1.Recordset!County Text6 = Adodc1.Recordset!Postcode Text7 = Adodc1.Recordset!Telephone
I hope someone can help?
Thanks
Loftty
Filling A MSFlexGrid With Large Amount Of Data Quickly...
The objective of my flexgrid is to give a view of a Cross query with 2 dimension giving to each cell a color format depending of the value in it...
I'm currently using a flexgrid to do the job and filling the grid manually from a ADO recordset. First I create all my rows header, my cols header and then I put each data in the right cell with its right color format...But, I have slow performance with large amount of data, for example, when I have 9000 columns or so, it takes too much time to fill it...
I've tried to bound the grid via a Data object containing a recordsource for a Cross query sql code but Access gives a 421 error saying there is too much columns (9000)...
Well, if anybody knows a quick shortcut to fill the grid or another grid control free better than Flexgrid...tell me please!!
(My data have to come from Access tables...)
Thanks...
Filling A Data Combo Control From Database Table At Run-time
I am stumped. If I use a literal string in my SQL query below I get the correct result. If I use the value in a textbox, I get nothing. Not sure why.
Below: if instead of what I have in bold I insert 1001009, my dbcAccountID populates correctly, but not with txtCustomerID.text.
Any thoughts?
CODESQLCustomerAccount = "SELECT Customer.CustomerID, CustomerAccount.AccountID FROM Customer LEFT JOIN CustomerAccount ON Customer.CustomerID = CustomerAccount.CustomerID WHERE CustomerAccount.CustomerID = '" & txtCustomerID.Text & "'"
With rsCustomerAccount
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Open SQLCustomerAccount, conMB, , , adCmdText
End With
Set dbcAccountID.RowSource = rsCustomerAccount
Automatic Filling Form ,browsing Site And Saving Data
Hi !
I am looking for a tool or help for writing a tool so that tool can open a site click on link "find" on that site so that "find page" comes up and then in text box for find write some number and cliks on "find" button, now site will generate all data that it found , this data should then be copied in a word file . and it keeps on doing for particular range of numbers.
Thanks
Naveen
MySql Data
first, can someone explain to me the difference between using
Code:
Dim rs as new ADODB.recordset
and
Code:
dim rs as ADODB.recordset
and not creating a 'new' one? i've noticed that sometimes people use it and sometimes not.
another thing is adding records to a table. i always though you had to do
Code:
sConn.execute "INSERT ... ... ..."
but today saw a database which did something different...
Code:
sql = "SELECT ID, F_Name, L_Name, Phone FROM tblPeople;"
rs.Open sql, sConn, adOpenKeyset, adLockOptimistic, adCmdText
rs.AddNew
rs!F_Name = txtF_Name.Text
rs!L_Name = txtL_Name.Text
rs!Phone = mskPhone.Text
rs.Update
can someone give me a bit of insight? is there a better/worse way of performing certain functions?
Get Data From A Mysql Db
Hi there! HELP me i'm desperate!
I have to make an app that comunicate with a mysql db from my hosting acccount. The problem is that The server has timeout =60 seconds
I can't stay connected to the data base more than 59 sec.
How can I retrieve the dat do a dxdbgrid? I tried with a recordset but every time I close the adodb connection the grid become empty.
Code:
Dim conn As adodb.Connection
Dim RS As New Recordset
Dim df As New Recordset
Set conn = New adodb.Connection
conn.CursorLocation = adUseClient
conn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _
& "SERVER=12.12.12.12;" _
& "DATABASE=clienti;" _
& "UID=user;" _
& "password=pass;" _
& "OPTION=" & 1 + 2 + 4 + 8 + 32 + 2048 + 16384
conn.Open
RS.Open "select clientid , name, email, address, tax, ref, title, access from ti_client order by clientid", conn, adOpenStatic, adLockOptimistic
Set df = RS
dxDBGrid1.Columns.RetrieveFields
dxDBGrid1.Dataset.Refresh
conn.Close
Mysql Data Transfer
I have been looking now for 5 days trying to find out how to do this and yes I am new to vb6. What I am trying to do is,
1) have a screen that has two text fields. 1=date and 2=notes.
2) have a command button that when clicked sends the information from 1 and 2 to my web host and store the information in a mysql.
3) In another VB app. have a screan that when you click the receave button it gets the information from the mysql and shows the information to the end user.
This sounds so easy as I sit here and type this out but I have no clue. can someone point me in the right direction for this or if someone knows of a tutorial or example I would be most appreative.
I have bought three books now working on this. Teach yourself VB6 by Patricia Hartman...Visual Basic Programming for the absolute beginner by Michael Vine and Visual Basic 6 Complete. These are all great books but none seam to address what I am trying to do here.
Thanks in advance for any help anyone can give me.
A4 Page - Data From MySQL
I am planning on writing software where a user can open a document (A4 Page) and see different controls on the page (text boxes, check boxes, and combo boxes) where the data comes from a MySQL database, but can also be updated.
Ideally I do not want to hard-code each document as a seperate vb Form because at a later date there will be more documents to add, and I would like the user to be allowed to see these documents without updating their software.
My first idea was to get the MySQL data, and then generate .DOC files and use Word, but then the data cannot be updated easily.
Can anyone give me any tips on how I can go about doing this?
Thanks in advance.
Data Grid + Mysql
I have tried a number of things that I've found using search, I've tried seperate methods, and I've tried different types of grid - I just can't get a data grid to accept grid.DataSource = recordset. It will either tell me type mismatch, or give me error 91 or it will give me error 30023 (unable to access data, datasource may be...). My code looks something like this:
Code:
Dim rs as new ADODB.Recordset 'the recordset
Dim dbConn as new ADODB.Connection 'the connection
Set dbConn = New ADODB.Connection
Set rs = New ADODB.Recordset
dbConn.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _
& "SERVER=" & sName(1) & ";" _
& "DATABASE=" & dbName(1) & ";" _
& "UID=" & UID(1) & ";" _
& "PWD=" & PWD(1) & ";" _
& "OPTION=" & 1 + 2 + 8 + 32 + 2048 + 16384
dbConn.Open
rs = dbConn.Execute("SELECT * FROM table;")
With DataGrid
.DataSource = rs
.Refresh
End With
But like I said, I just can't get it to work. It connects to the database and everything, the server is running, etc, etc. Right now all I want to do is get all the columns and rows in a table and put them in the grid. Any help would be most appreciated. Thanks.
Submitting Data To Mysql
Ok I have recently made a game in Vb6. At the end you have a score (number score) Example: 45
Ok I want to submit the score and the name of the player to a database on my website by using a command button.
And on my website I want to make a List of all the peoples names and there score
So basically. When you push the command button it ask for your name and it sends the score and there name to mysql
Im new to mysql, and ill have to look at another forum probally to figure out how to post everyones scores on my site. But Can anyone help me with this part?
|