Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Need To Store Database ID And Description In Combobox


I am using 5 comboboxes for data entry. Once the user has selected the description I need to get the ID that relates to the description selected without having to perform another select statement. Is there no way that I can store the ID together in the combobox with the description.
Thanks

"The answer is out there, Neo, it’s looking for you. And it will find you, if you want it to."--Trinity to Neo




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Adding Description To The HEADS Of A Combobox Or ListBox
HI!!!!!
my problems today is to know how to show a header column text to my combobox...

im using the combobox of the microsoft 2.0 forms object library (fm20.dll)

i want a combobox with 2 columns... all is ok but i just mistake to add a column header description for each columns.

my code is:

combo1.ColumnCount=2
combo1.ColumnHeads=True
combo1.additem " "
combo1.List(0,0)="comuln head 1"
combo1.List(0,1)="column head 2"
' or combo1.Column(0,1)=............

this code add me 2 heads on the combo, but the text inside is empty...
from the examples i read that this is the code for add a column head, but is not working.

HELP

thnk

Dynamic Combobox (description And Keyvalue) Filled By The Databse
'============================================== 'Routine: addDBToComboBox
' Description: Dynamically popup combo box from a database
' Parameters: cmbBox, Key
' Returns: None
'==============================================

Public Sub addDBToComboBox(ByRef cmbBox As ComboBox,
ByRef cn as ADODB.Connection, Byref SQL as string,
StoreIndexInTag As Boolean, Optional Id As Variant)

On Error GoTo ErrPara

dim rs as new ADODB.recordset

'cn is the connection string of the database
'
rs.Open cn, SQL

do while not rs.eof

' First recordset field should be key field

If IsMissing(Id)Then
cmbBox.Add rs.fields(1), rs.fields(0)
Else
mcolCombos.Add rs.fields(1)
End If

rs.movenext
loop

rs.close

set rs=nothing

ExitPara:
exit sub
ErrPara:
Err.Raise Err.Number, Err.Source & "/clsComboHandlers.Add", Err.Description
goto ExitPara

End Sub
~~~~
If you need help, contact me at binoy_rb@hotmail.com

Store ID And Name In Combobox
I get data from Database. I hav two fields(CustomerID and CustomerName) varchar datatype. I want to display CustomerName and Store CustomerID in a combobox. So when user select a customer i can get his/her ID. There is ItemData property, but it can store only Long value. How can i do?

Description Of An Acess Database
hi,

i would like to generate a list of all the fields of a table and i do it like this:
sql = "describe table1"
but the word describe is not known, is this because i have an Access database?

thanx in advance

Database Error Description With DataEnvironment Help
I am trying to get the Database Error Description when using the DataEnvironment. The following code is when you get the database error description when you setup the adodb directly.

On Error GoTo cmdSelect_Error:
Dim errSelect As ADODB.Error, pstrMessage As String
Dim cnn1 As ADODB.Connection
Dim rstRAT As ADODB.Recordset
Dim strCnn As String
Dim strDBLoc As String
strDBLoc = GetSetting("FTPCP", "Path", "DB", "0")
strDBLoc = strDBLoc & "
at.mdb"


'Open an ADO connection
Set cnn1 = New ADODB.Connection
strCnn = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=" & strDBLoc
cnn1.Open strCnn

'Open RAT table
Set rstRAT = New ADODB.Recordset
rstRAT.CursorType = adOpenKeyset
rstRAT.LockType = adLockOptimistic
rstRAT.Open "RAT", cnn1, , , adCmdTable

'Add the new record
rstRAT.AddNew
(etc.)

cmdSelect_Error:
pstrMessage = "There was a Database Error" & Chr(13)
For Each errSelect In cnn1.Errors
pstrMessage = pstrMessage & errSelect.Description & Chr(13)
Next



Does anyone now how to read the description errors from the database when you have a DataEnvironment set up. The name of my DataEnvironment is deFTPVerify.


Thanks for your help.

How To Store String As ComboBox's ItemData
Is there anyways to do this? I've been looking high & low but can't find anything except how to store integer as itemData property.

If not is there any ways to link a string to a Combobox item?
I'm willing to use another hidden combobox if I have to at this point but I can't figure out how to go about it @?!#

Any suggestion welcomed, thanks

here is the piece of code I'm reffering to:


VB Code:
Private Sub Command1_Click()   Combo1.AddItem Label1.Caption   Combo1.ItemData(Combo1.NewIndex) = File1.Path End Sub

Store UD Type Var In Combobox Itemdata
Hi,

How can I store a variable of a Type that I have defined?

Can I store a pointer to a type in ItemData?
Why can I not define a new type var as
dim test as new mytype?

I'm used to using the ItemDataPtr property in VC++ and can't get my head round this one.

Help please

Thanks

How To Find And Store Combobox ListIndex To ListView
Hi there
I hv to store index of an item selected from combobox to list view control. I am using following code lines but they show nothing but zero for all items. Kindly help to sort out this problem.
Thanks

For cbIt = 0 To frmEditTrans.CboItems.ListCount - 1

For edLv = 1 To frmEditTrans.LvEdt.ListItems.Count
If CboItems.List(cbIt) = LvEdt.ListItems.Item(edLv).SubItems(2) Then
frmEditTrans.LvEdt.ListItems.Item(edLv).SubItems(20) =CboItems.ListIndex
Exit For
End If
Next edLv
Next cbIt

Access Databses To Store *.Text And *.ComboBox
Yup, it's me again

I was wondering, how would I set up an access database to save the values for each *.Text and *.ComboBox in my application, and then go back and be able to recieve it?

Note, I want one file for each skin, remember my application is a CSS generator ;)

Also note, I have no clue about ANYTHING that has to do with Access XP (that's the version I have).

Reading ADSI Database With VB && Store In SQL SERVER Database
This is first time I m looking for help in any VB forum I hope I can get some useful hint or help regarding my current problem. Let me describe in brief what we want:

We have one vb application which uses the MS-SQL Server Database. We want some changes in the login screen as per our new requirement.

What we want
1)We want to add one form which will show one button called ‘Update Users’ on clicking the button application will read the current users from the ADSI and store/update in the SQL-DATABASE(User Name and password in the existing table in our database).

2) When we will start the application system checks for the current windows user name and password if same user name and password exist in the MS-SQL Server database then there is no need to show login page but if the user name or password not in the database then prompt for the Login Screen

Please help me to find out how to read the ADSI Database using the VB Application email (bestloveh@yahoo.com)

Thanks

How To Link A Combobox From A Database To A Combobox On A Form.
Goodday There,

I have a problem with linking a dropdown combobox from the database to a dropdown combobox in a form, Please help and I'm using access database by the way.

Thank you in advance...

Mfanelo

ComboBox - Displaying Database Values In A ComboBox
I am trying to insert values from a database into a combo box.

I have linked the datacontrol to the combo box and values from the database are displayed within the combox box. However can only be navigated using the data control. I would like the values to be listed within the drop down list of the combo box.

Can anyone help pls?!?!


Roshny

Filling A Combobox From Database But I Don't Want Duplicates In Th Combobox.
I want to output the contents of a database field (ms access) to a combobox but the field has many duplicates that I wish not to display. I just want one of each. Thanks

Store PDF In Database
Hello!
I need some help.
Can I store pdf files in a mysql database.

I see lots of exemples to store pictures but how can I store a pdf binary file ?

Anybody know a link to the problem ?

Thanks

How To Store In Database?
Hi all,
I have a problem regadring batabase.
I want to store some text in the specified format. ( I have showed it in the sanp "word format.jpeg" attached with my thread) I have typed the text using the "format"--> "asian layout"--> "phonetic guide" which is available in Microsfit word. But even if i copy this specified text and paste it in access database, it doesn't works. Its allignment is getting disturbed.
I have showed it in the snap "database.txt".
How can i save it in databse in the specified format?
Any anyone have the solution.
Pleaseeee help.....
Anita

How To Store Pictures In Database
Hello there,
Can u please tell how we store the pictures in the database like MS-ACCESS. and then how we can retrieve them??
Thanking you in advance

Sachin

[java:help]store Value Into Database.
1)how to store combobox's value and radiobutton's value into the database?
2)if i have a combox box that contain "customer ID" from database, once i select the value from the combo box, the "customer name" (in the textbox) refer to that "customer ID" that i select will appear automatically.

thanks

Database Image Store
dear friends,
how do i save image in access database similar to format that Northwind database use in their employee table.
thanks friends

How Do I Store A DataReport In A Database?
My question is: How do I store a DataReport in a database (MS ACCESS)?

Can I store it as a View if I have the SQL syntax that created it?

CREATE VIEW MyView (field1, field2)
AS SELECT ...
...
...

I run something like this above in a cxnAccess.Execute but I received an error of "Method execute of _Connection failed". I run it on a MS ACCESS 97 and on a MS ACCESS 2000 but the same error appeared.

Is there some other way of storing my SQL SELECT command that creates the DataReport in the MS ACCESS database?

Store Images In Database
OBJECTIVE: I have a combobox that shows a list of car names. I would like to make the car names kind of like a hyperlink that when it is clicked, a new form will show displaying image of the car.

My car names are stored in Access database. I was told that I could store images in the database and it can be linked to the car names inside, in order to do the above stated objective.

Anyone knows an easier way to do this..? Codings or links to the solution would be greatly appreciated. I heard that it is a very difficult problem to solve.

Thank you.

Store Picture In Database?
Is it possible to store picture in a database such ms access, or the path only?

Store CheckBox Value On Database
1. How can I store a database value on a SQL database's table??

I have 6 checboxes and I need to store if they are checked or not, just that... Is ther any kind of var like Access' Yes/No value?

2. Do you know where can I find any example about storing an image in the same database?

Thanks...

Store Pictures In Database
Dear all,

I want to save pictures in MS Access database through VB 6.0 . Can youplease help me with a peice of code and resources/links on net which canhelp me to do this.

I want to save as well as retrieve the files.

Thanks in advance.

Store Emails In A Database Using Vb Or Asp.net
hai ,
i am suresh. i want create an application that should store emails to access
database from a mail account.
using any one of vb or asp.net.
can you please give me some sample code for that.

How To Store Picture In Database

Hi Friends,

      I'm developing payroll package in which i want to store the photo of an employee against his ticket no..How do i go about it,i'm using oracle 8i and vb 6.0.Please suggest its urgent.Thanks in advance.

Regards,
Prashant.

How To Store /,-,. As It Is To Database - Access
Hai Friends,

    In my project, i am using decimal values. My problem is while adding those values, it is rounded & stored & while retrieving that rounded values r shown in Text box.

    I am using Access database.

I choosed Data type as number

& In General,

    Field Size is Decimal
    Format is fixed
    decimal Places is 2

In the database structure, it is shown as " 1.00 "

   If i add the value as, 3.15 & store it to database, it is stored as 3.00 & while retrieving it back it is shown as 3.

I want to store the value whatever i had given to text box.


help needed

Regards

Geetha

Edited by - Geethahiren on 5/26/2005 3:37:01 AM

How To Store Documents In A Database
hello all,

am trying to figure out how to store a word document, or an excel document or any other image or document or presentation file in a database. I dont even know if its possible, but i kinda wanna find out if it will be possible.

looking forward to hearing from all you guys.

regards

-Vinod

How To Store Picture In Database
Hi every i have following code when i want to execute the program i gives me runtime error 545
Un able to bind field or data member"Picture"
my table have three field one is Pubid and othe txtdecription which hold text and third one Picture which is type OLE to hold picture pub when i excute i get above error please help
I m using office xp acess xp

    Option Explicit
    Private cn As ADODB.Connection
    Private rs As ADODB.Recordset


    Private Sub Command1_Click()
     'making txtdescription show whats in the description field
        rs.Fields("Description") = txtDescription.Text

        
        rs.MovePrevious
          'just to make sure your at the start and so you don't get that error.
        If rs.BOF Then rs.MoveFirst
        
        FillFields
    End Sub

    Private Sub Form_Load()
        
        Set cn = New ADODB.Connection
    'make this the path to the image database.
        cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
          "Data Source= C:picdata.mdb"
        cn.Open
        'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:picdata.mdb;Persist Security Info=False
        
        Set rs = New ADODB.Recordset
        rs.Open "Table1", cn, adOpenKeyset, adLockPessimistic, adCmdTable
            
        
        FillFields 'this is a sub that I'll explain later.
    End Sub
     

    Private Sub cmdPrevious_Click()
          'making txtdescription show whats in the description field
        rs.Fields("Description") = txtDescription.Text

        
        rs.MovePrevious
          'just to make sure your at the start and so you don't get that error.
        If rs.BOF Then rs.MoveFirst
        
        FillFields
    End Sub
     


     
    Private Sub cmdNext_Click()
          'making txtdescription show whats in the description field
        rs.Fields("Description") = txtDescription.Text
        
        rs.MoveNext
        If rs.EOF Then rs.MoveLast
        
        FillFields
        
    If rs.EOF Then
        MsgBox "At last record" 'avoiding that nasty error.
    End If
    End Sub
     

     
    Private Sub cmdDelete_Click() 'this will delete the entire record.
        If Not (rs.BOF And rs.EOF) Then
            rs.Delete
            If Not (rs.BOF And rs.EOF) Then
                rs.MoveNext
                If rs.EOF Then rs.MoveLast
                FillFields
            End If
        End If
    End Sub
     
    Private Sub cmdAdd_Click()
        Dim bytData() As Byte
        Dim strDescription As String
        
        On Error GoTo err
        
        With dlgAdd 'remember the common dialog box.
              'filtering so only jpg's and gifs are shown!
            .Filter = "Picture Files (*.jpg, *.gif)/*.jpg;*.gif"
            .DialogTitle = "Select Picture" 'sets the title of it.
            .ShowOpen 'show the open dialog box.
               
              'bit to "convert" the image to binary.
            Open .FileName For Binary As #1
            ReDim bytData(FileLen(.FileName))
        End With
          
        Get #1, , bytData
        Close #1
        
          'show a input box to enter description to the description field.
        strDescription = InputBox("Enter description.", "New Picture")
        
        With rs
            .AddNew
            .Fields("Description") = strDescription 'adding record to db
            .Fields("Picture").AppendChunk bytData 'Here error occur adding the picture to the db
            .Update
        End With
        
        FillFields
        Exit Sub
    err:
        If err.Number = 32755 Then 'simple error check.
        Else
            MsgBox err.Description
            err.Clear
        End If
    End Sub
     

    Public Sub FillFields()
        If Not (rs.BOF And rs.EOF) Then
            txtDescription.Text = rs.Fields("Description")
            Set Image1.DataSource = rs 'setting image1's datasource
            Image1.DataField = "Picture" 'set its datafield.
        End If
    End Sub
     
    Private Sub Form_Unload(Cancel As Integer)
        On Error Resume Next
        rs.Close
        cn.Close
        Set rs = Nothing
        Set cn = Nothing 'closing all connections.
    End Sub

Store Vb Function In Database Field
I am busy writing a program used to calculate product date codes.
A typical date code would be: L4152D 12 05. This code is broken up as follows: The L is different for every product code. The 4 stands for the year. The 152 is the 152nd day of the year. The D stands for the shift inwhich the product was made (can also be N for nightshift) and 12 05 is the expiry date (some expiry dates have different formats). To summarise a date code stores customer specific information, date and shift of production and expiry date. I want to build this logic into a database. For each product code I can have a 1 to many relationship describing the relavant code. For example:

Product code
8652

Date Code
8652 L
8652 Year
8652 DayOfYear
8652 Shift
8652 Expiry Date

First of all how do I get the day of the year?
And how do I store a function like dayofyear in a database, I want to select the function from the database without having to interpret it before I can use it? I would also need to store functions like vbCrLf in the database.
How do I store these functions in a database?
aLiEn777

Best Place To Store The Path To My Database
All

I have a multi user access database,

My users can all access the database where it is stored on the network but what i would like to be able to do is allow an adminstrator to specify the path to the database.

I am using an MDI form so can store the path there but where (And How) is the best place to store the path to the database so I can call it at run time

Thanks

Gibbo

How To Store Image/Picture Into Database
hi,
please let me know how can I store the picture files like .JPG, .Bmp, .ICO into jetdatabase using VB6.

I define a table with one field called "img" type =memo, it won't work.
please help me to fix the problem.

thanx.

Store Picture To Database From PictureBox
Dear Sir,
I will be very glad if you can inform me how to store pictures in the database but I faced some compilition errors when use this statement: rstTemp("ps") = file_length could you please inform me what is the structure for the databse table? also I would like to know how to define recordset in order to write rstTemp("ps") = file_length without errors..
thank you very much and your quick reply is truly appreciated.


Quote:




Originally Posted by RobDog888
From RhinoBulls signature -

Save image to database

Read image from database

Store Picture To Database From PictureBox
Hello i have a question!

I have an application where i store pictures to database. I can store a picture to database using StrFile = CommonDialog.FileName (where StrFile is declared as string) and ADODB.Stream object where i load the StrFile and then through adodc properties i managed to store it into the database as BLOB.

But now i have a problem. I have an image explorer where i see all the pictures that are in a folder as thumbnails by using image as index. Then when click at one i made appear in another form where i have a picture box. How can i save the picture that i have in the picturebox into the database without using the CommonDialog.FileName?? The ADODB.Stream.LoadFromFile (want's a string). How can i do this??

Thank's!

How To Store Image In Oracle9i Database
hello friends,
i am doing a project using VB6 and oracle9i. i have to store picture in database of oracle but i dont know how to do this. help me...

Creating A Database To Store Scores?
Hey all,

I have created a game for 1st grade kids and I need a way to store the kid's highscores after they finish the game, so the other kids have something to shoot for when they play the game. I have see in other posts stuff about databases, but I know nothing about them. What would be the best way to store and then send back to my program about 600 "high scores" from 30 computers?

thanks

How Can I Store Pictures In Access Database.
how can i store pictures in access database.
I'm trying out a simple address book app using the adodc control,the problem is how to load the pic on the form in vb,then what about when i have an add button on my form , how does this work,
any hlp appreciated
thks

How To Store Pictures In Database Fields
hi friends

can anybody tell me how to store pictures in database fields
i am using access as backend

pl. help me......

Store Word Range In Database
VB opens an MS Word document and gets a range of the document (a chunk of the document). Can I save that to an Access database with all the formatting? I know you can save a whole document as binary, but can you save just a part? Or another way, can you save the exact Data from the Clipboard to a database? Possible?

How To Store And Retrieve An Image From The DataBase
Help me to retreive and store an image from the dataBase

Store OLE Object In Database Field
I want to insert a Microsoft Graph object in a "OLE Object" field in a database because I want to print a graph for each record with Crystal Reports. I think the code should be something like this:

Dim grp As Graph.Chart

set grp = CreateObject("MSGraph.Chart")

rst.edit
rst.fields("Graph").AppendChunk ???
rst.update

How do i get the data from the Graph Object to use it in the appendchunk?

I have used a OLE control "oleObject.Action = OLE_SAVE_TO_FILE" and then read the file into the field but the format is not correct.
When i paste the object through access or through OLE control bound to a Data control I get "Microsoft Graph 97 Graph" in the database and the graph is printed correctly.
But if i use "OLE_SAVE_TO_FILE" and then read the file i get "Large Binary Data" and the object doesn't get printed.

Another option could be using OLE control's "Data" property putting "CF_METAFILEPICT" in the format, but then how do I get the data pointed by "Data".

Thanks in advance.

Miguel Yarza

Store And Retrieve File To And From Database Using ADO
Hi,
How can I use ADO to store and retrieve a file from a
database. What are some things that I need to know or do?

How To Store Database Records Into Array With VB.NET?
I want to retrieve all records from an MS Access table and store them into an array. Can someone give me an example of how to do that in VB.NET? Thanks in advance!

How To Store Image In Oracle Database?
Hi Everybody

how to store image in oracle database?


I am using CLOB to do that in the follwoing example But i am unable.
Plz help What wrong here

If there another way to solve my problem then plz sujest!


lokesh
lokeshnow@yahoo.com


Dim CN As ADODB.Connection
Dim rs As ADODB.Recordset
Private Sub Form_Load()
Set CN = New ADODB.Connection
CN.ConnectionString = "Provider=MSDAORA;user id=LOKESH ;password=YAHOO;DATA SOURCE=BTECH1 "
CN.CursorLocation = adUseClient
CN.Open
End Sub


Private Sub Command2_Click()

'On Error Resume Next
Set rs = New ADODB.Recordset

rs.Open "select * from IMAG", CN, adOpenDynamic, adLockOptimistic

If textbox1.Text = "" Then
Else
rs.AddNew
rs!cdata = textbox1.Text
rs.Update
MsgBox "Record Updated....", vbOKOnly
End If

End Sub



Private Sub Command1_Click()
Open "C:ARNOLD.JPG" For Binary As #1

While Not EOF(1)
Line Input #1, temp$
alltext$ = alltext$ & temp$ & vbCrLf
Wend
textbox1.Text = alltext$
Close #1

End Sub

How To Store File In Oracle Database
hi everyone,

i want to store and retreive file of any format into oracle database using visual basic .
can anybody help in this record.

thanx in advance
rsvn

How To Store A File Into Sql Server Database?
Hi frens,

I had been search around in the forum but i can't find any related topic that can solve my problem. The question of mine is How i can store a file ( eg. txt, doc, excel ) into a field. Im using VB6 + SQL Server database. in the table, what data type should i assign to the field that i want to store the file? varbinary or image ??

as i saw from the forum there is only have VB6 + MsAccess database. Is it the same way that i need to follow?

I hope someone here can help me. Thanks.



Renee

How To Store Null Value In Database Using Datacombo
how to store null value in database using datacombo

Store Label Text Into Database
How can i take a number that was entered by a user in a label within a form, and store that into my database in a field called "totalScore"

How To Store Data In Database Using MSFlexGrid?
How can i store the data in a database using MSFlexGrid.I also like to know where i can get sample code for MSFlexGrid.

Copyright © 2005-08 www.BigResource.com, All rights reserved