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




Database Table To Richtextbox


Hi,

I want to create lines in a richtextbox from records in an access database. I was wondering if there was a way to print lines into a richtextbox, rather than setting the Text property. So I could just loop through the records and write a line in the richtextbox each time separated by a vbCrLf. I hope there is a simple way to add a line each time, but I haven't been able to find one.
In the alternative I guess I could populate an array in the loop and then print the array when I was done, but the first way would be quicker.

Thanks -
nick




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Move A Record From One Database Table To Another Database Table In Visual Basic Us
Hi
 
   plz help me

  How to move a record from one database table to another database table in visual basic using MSAccess Database
  using ADODB Record set.


  Datbase A from table a
           to
  Database B to table b.

   

Thanks


Yours

mk_mur

Table In RichTextBox
how can i add table in RichTextBox1?

and save it to database of access and then retrieve it back in the same position also i want to save formatted text into the database and retrieve it in the same position.
Thanks all

Inserting A Table In A RichTextBox
I would like to use a RichTextBox, from VB, to make my report. My question is if I want to put my data in a table with 3 columns and insert the new data into a new row, how can I do that? How can I introduce in a RichTextBox a table? I could not find any example about this!

Thanks in advance

My very best regards,

Celso

Create A Table In RichTextbox(VB.Net)
hi all...


Really i wanted to insert Table in Richtextbox (VB.NET)....

plz help me to do this....





thanx in adv

parkavi.m:

Select A Table In Richtextbox
Hi all,

I opened my rtf document in richtext box control. The document has 4 tables. Is it possible to select the table (1st or 2nd) through code in richtext box control. want to select it and do some stuff!

thanks in advance.

Column Or Table In A Richtextbox Control
Hallo!

I need help on setting columns or creating table in a richtextbox control

Thanks for helping

James

Find ALL Access Databases That Have A Linked Table To My Database Table
I have an uncountable amount of links to a highly used table out there on my network. It would take an unthinkable amount of time to track down all links.

Is anyone aware of a way to determine the names or locations of databases that contain a linked table to my table which is being linked to?

I hope this question makes sense. Let me try a very general explanation below in addition.

Tables X, Y, Z... are all linked tables in databases X, Y, Z... to a table T in database T. Is there anyway to find X, Y, Z...?

Thank very much for any info, I am glad to have found VBcity!

Travis

Problems With CE Characters And Code Table In RIchTextBox
Hi!

I have problems using CE characters (č,,) in RichTextBox. If I set the font as a property the characters are set correctly, but if I change the font using SelFontName property, the code table changes (as well as Language indicator in the TaskBar) and wrong characters appear.

This only happens with fonts that don't have separate CE versions, although all other fonts support those characters as well (after all they are shown correctly if set by Font property or if used in other programs)..

What could be wrong?

Bostjan

VB6 - Copy A Table's Columns To Another Table Within The Same Database
Hi everyone,
I have two access tables "TableA" and "TableB" TableA has 9 columns and TableB has 4 columns. I created a new table "TableC" with 5 columns. I want to copy 3 columns from TableA(with its data) to TableC and Copy one column from TableB to TableC . I added a new column to TableC and this column will only contain the indexes of a column from TableA. After copying those columns, I want to delete the copied columns from TableA and TableB. My final objective is to make two of the fields(columns) in TableC a foreign key to TableA.
All of these tables reside within the same MS Access database.
What is my best code approach to accomplish this objective?
Thanks.
tgif
P.S. I am developing in VB6.0 environment.

Edit by loquin: moved to the classic VB database forum.

I Need To Move A Record From One Table In A Database To Another Table.
I Have a Program i'm writing for my college course

I need help Moving one record from one table in the database to another

I'm Using a ADO Control in the Program.

PLEASE HELP!!!


THANKS,

LYLE,

{ Computers are like air conditioners, They work fine until you start opening windows }

Create Table With Same Table Structure In Different Database
hi to all
i have a prob...


i want to create a table with same data structure of different table but table is in another Database... i am usin ADOs in VB

and the Database is MS ACCESS

/...
plz reply asop... as i require it urgently

waiting 4 your response
Jatin

How To Copy From One Table To Another Table W/in The Same Database Using Vbcodes
Lets say i have DBName.mdb. inside it is a table named Table1. I want to copy Table1 as another table named Table2. Both Tables are still inside DBName.mdb. How will i do that through VBCodes?

VB6 - Copy A Table's Columns To Another Table Within The Same Database
Hi everyone,
I have two tables "TableA" and "TableB" TableA has 9 columns and TableB has 4 columns. I created a new table "TableC" with 5 columns. I want to copy 3 columns from TableA(with its data) to TableC and Copy one column from TableB to TableC . I added a new column to TableC and this column will only contain the indexes of a column from TableA. After copying those columns, I want to delete the copied columns from TableA and TableB. My final objective is to make two of the fields(columns) in TableC a foreign key to TableA.
All of these tables reside within the same MS Access database.
What is my best code approach to accomplish this objective?
Thanks.
GiftX.

VB6 - Copy A Table's Columns To Another Table Within The Same Database
VB6 - Copy a table's columns to another table Within the same database
 
 
Hi everyone,
I have two tables "TableA" and "TableB" TableA has 9 columns and TableB has 4 columns. I created a new table "TableC" with 5 columns. I want to copy 3 columns from TableA(with its data) to TableC and Copy one column from TableB to TableC . I added a new column to TableC and this column will only contain the indexes of a column from TableA. After copying those columns, I want to delete the copied columns from TableA and TableB.
All of these tables reside within the same MS Access database.
What is my best code approach to accomplish this objective?
Thanks.
GiftX.
 
 
bednarjm -
Please don't cross post. The discussion is continued here:
http://www.vbcity.com/forums/topic.asp?tid=150258

 

Edited by - bednarjm on 10/31/2007 10:12:04 AM

Insert Data To A Table From Another Table Which Is In Another Database
Can anyone help me

I want to insert data to a table from another table which is in another database through VB 6.0

bala

VB6 - Copy A Table's Columns To Another Table Within The Same Database
Hi everyone,
I have two tables "TableA" and "TableB" TableA has 9 columns and TableB has 4 columns. I created a new table "TableC" with 5 columns. I want to copy 3 columns from TableA(with its data) to TableC and Copy one column from TableB to TableC . I added a new column to TableC and this column will only contain the indexes of a column from TableA. After copying those columns, I want to delete the copied columns from TableA and TableB. My final objective is to make two of the fields(columns) in TableC a foreign key to TableA.
All of these tables reside within the same MS Access database.
What is my best code approach to accomplish this objective?
Thanks.
GiftX.

Updating An Access Table With A Table From Another Database
I'm trying to update a table using Access 97 and VB5 with an identical table in another database that contains changes- changes within the records, addtions & deletions of records. The update works as longs as there were no deletions or additions. The old table can't be replaced because of existing relationships. If the old table is deleted other information in different tables will also be deleted. Database replication is really not an option. Thanks.

VB6 Or VBA - Copy Table Contents From One Database To Identical Database
Ladies and gentlemen,
first I want to wish each and every one of you a wonderful and prosperous new year.

This is not really a problem. I am looking for an efficient and quick way to copy table content from one database to identical tables in another identical database.

I have two Access databases: "PTSPROD" which is production database and "PTSTEST" which is a test database both databases have 10 identical tables each.

Objective: I need to erase the contents of 5 of the tables in "PTSTEST" then copy contents of 5 similar tables from "PTSPROD" into "PTSTEST".

I could mannually delete the table contents, then copy and paste, but that will be crude.

Question: How can I programatically accomplish this task faster?

Thanks.
tgif

How To Import MySql-database Table To Access-database
I'm building a client-database in .NET for my work and I'll have the program copying rows of data from the online MySQL-database to a local offline Access-database. Everything looks alright when opening the local database in Access but when opening it in my app I get an error saying that the index or primary keys will conflict because of duplicates. I have tried endlessly to switch primary keys, creating new ones but nothing seems to help. Any suggestions?

Advanced Table In VB6 (Non Database Table)
Hello. I have to put some information in table but I also need to insert command button in this table. Does anybody have any idea which control to use ?



Thanks

Saving RichTextBox To Database?
Hello, all.

I am developing an application that needs to save the contents of a RichTextBox to a database (either Access or MySQL -- I haven't decided yet). I assume you would use a large Text field ("memo" in Access), but is there a proper way to save (and retrieve) the data so that the formatting of the RTF text is preserved?

Thanks!

Retaining RichTextBox Format In Database
Hello,

I am having a problem to have the formatting of my rich Text Box in a Form to be retained when I do an Insert Into Sql Statement.

The text in the RTB is saved in the Access Database but alle the Bold Face, Underline, etc... is lost when I call back the saved text from the database.

Any solution to help me with this problem?

Mark

Save Richtextbox's Contents Into Database??
I input some contents(include characters and pictures) into richtextbox,now i have a question about this how can i insert it into database and how to read richtestbox's contents into richtextbox(content the same as before) again.

Richtextbox-displaying Text From A Database
I want to view reports in visual basic. when I read data out of a database and send it to a richtextbox
it overwrites the first line of the richtextbox over and over again. This results in the last line of the
report showing in the richtextbox only. How do I make the richtextbox show each line of the report.
I have used a listbox with a list1.additem statement, but I would prefer to use a richtextbox so I can
controll fonts and size of text as it is displaying in the richtextbox.

Saving Image From RichTextBox Into ADO Access Database
hello all,

I have a RichTextBox control and want to save the contents of it into Access database using ADODB connection.

Text saves up nicely, but how can I save the images in the RichtextBox as well?

Problem When I'm Trying To Save RichTextBox Data Into Database...
Hi..
I have problem when i'm trying to save RichTextBox data into database.
I have 2 command button, 1 Adodc and 1 RichTextBox, rtbAddress.
This is the code,
Code:Private Sub cmd_Add_Click()
Adodc1.Recordset.AddNew
End Sub

Private Sub cmd_Save_Click()
     Adodc1.Recordset.Fields("Receiver_Address").Value = rtbAddress.TextRTF
     Adodc1.Recordset.Update
     Adodc1.Recordset.Requery
End Sub

When i open the database..the result for the Receiver_Address is something like this..

{
tf1ansideff0deftab720{fonttbl{f0fswiss MS Sans Serif;}{f1fromanfcharset2 Symbol;}{f2fswiss MS Sans Serif;}}

Any idea?

How Do I Save RichTextBox Text Format(with Bold Etc) In Database Field
Hi Guys,

How do I save the rtb text in a table field and then display that same text with the bold and italics still intact in a rtb on another form.

Need To Display Hindi Or Bengali Text For Access Database To VB RichTextBox
Hi,
I am using access database, where I store Hindi or bengali text. Now using VB I want to display the text in RichTextBox.
But I am getting "?????????".
I am not finding any charset of Hindi or bengali.

Can you please help me and let me know how to solve this problem?
Sandipan

How To Copy A Table In One Database Into Another Database?
Hi all,

I'm trying to insert the contents (column and its data) of table 'Temp3' (just contains one column called 'HLSCODE') in the FAP.mdb to a table 'Temp4' in the HLS.mdb. The table 'Temp4' doesn't exist it is to be created with the SQL code I'm using which is below (I'm using Access 2000) :

SELECT * INTO
C:Program FilesHLSwinHLS.mdb.[Temp4]
FROM C:Program FilesHLSwinFAP.mdb.[Temp3]

When I run this code I get the following RTE '3067' :
"query input must contain at least one table or query"

What am I doing wrong? How do I create 'Temp4' in HLS.mdb with the contents of 'Temp3' from FAP.mdb??

Thanks in advance??

Copying A Database Table To Another Database
I was looking fro a way to backup my database from within my program and found this link
http://www.Planet-Source-Code.com/v...Id=540&lngWId=1

The code described there should do the trick. but when I run the program I got a compiler error sayin

Method or datamember not found. and then it points me to this point:

fldTo.DefaultValue = fldFrom.DefaultValue



why?

Import Table From Mdb Database To Another Mdb Database Using Vb6
hi all

I have tableA in dbaseA.mdb. Then i want to import this tableA into dbaseB.mdb using VB6.
anyone can help me

Import Table In A Database To Another Database
Dim dbs As DAO.Database

Set dbs = OpenDatabase("c:SppbSysUpdIndmsic.mdb")

I want to import or copy a table named "tblFrame" from ("c:SppbSppb.mde") included all the data
in the table to another database called ("Indmsic.mdb").

How should I code the programme ? Can anyone help me.......

Database Table Name
Can I assign a variable to represent a table name? This is my code and it says it can't find the table. But when I step into the program the table name variable displays the correct name.

Private Sub ShowValues

Dim db_file As String
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim sSQL As String
Dim Value As String
Dim TableName As String

Value = cmdShow.Caption
TableName = "tbl" & Value

'Get the data
db_file = "C:DB1.mdb"

'Open a connection
Set conn = New ADODB.Connection
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=C:DB1.mdb
conn.Open

sSQL = "SELECT * FROM [TableName]"
Set rs = conn.Execute(sSQL)

'Fill the list box
Do While Not rs.EOF
frmMaintence.lstTableValues.AddItem rs!Value
rs.MoveNext
Loop



End Sub

Table In Database
I'm a 54 years old teacher, newbie in Visual Basic 6.0, who makes programmes for children. The programmes are freeware on the site www.snuffelsoft.be (in Dutch only) Now I want to create a table in a database (ADO) but the name of the table had to be a word from a textbox . Children had to fill there name in that textbox and a copy of a table (grammar words) must be made in the database. So each child can work with his own table .
This is the code I wrote:

Set cn = New Connection
Set rsnew = New Recordset
With cn
.Provider = "Microsoft.jet.oledb.4.0"
.ConnectionString = App.Path & "spel3.mdb"
.Open
End With

If rsnew.State = adStateOpen Then
rsnew.Close
End If
rsnew.Open "Select * into" & " txtname " & "from basic3", cn, adOpenKeyset, adLockOptimistic

This is the code, and I want to change the txtname into a name from a textbox .
So I can create a table called Marie or Jim or Bart or ...

Database Table
i have a database with a table that content 2 fields and i have to show these two field in one combobox (2 column), is there a way to do this?

merry christmas !!!!

Database Table - UDT.
Hello all

A quick question. Well 3 actually.

I am looking at the way my application saves data to a database.

I considered creating a user defined type (UDT) that reflects the fields in a database table, populate the UDT and then loop through to create the SQL to update or append the table reords.

Is it possible to create a UDT dynamically?
i.e. Read in the database table structure and then use that to define the structure of the UDT?

Also is it possible to change the UDT structure once it has been defined?

Lastly do the UDT 'fields' have an index that can be used in a loop?

I think I might be bordering on OO here, maybe I need a class that can be extended when needed.

Comments appreciated.

Thanks
DRW

Database Table
Hi, I'm using this code to get the table data on my program it's working fine, but there is a problem ex. on the textbox i enter ".txt and then hit the search button then it show me the data, and now when i change to ".doc" it shows this error "The connection cannot be used to perform this operation. It is either closed or invalid in this context." What's the problem?
and when i hit the debug button it shade this line

error Code:
rec.Open (esql1), conn, adOpenStatic, adLockReadOnly


--------------------


alll Code:
Dim conn As ADODB.Connection, rec As ADODB.Recordset, esql As String, esql1 As String


Private Function connect()
      Set rec = New ADODB.Recordset
        Set conn = New ADODB.Connection
   esql = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=C:Documents and SettingsFido-DidoDesktopFile_Identifier.mdb;"
   'here you put the correct path of your mdb file. and check if you have jet 4.0

   conn.Open (esql), , , 0
  End Function

Private Sub form_Load()
connect
End Sub

'and for accessing records:

Private Sub command1_click()
'rec.Close
'conn.Close
'esql1 = "select * from filei where [File Extension] =" & Val(text1) ' for integers

esql1 = "select * from filei where [File Extension]=" & "'" & Text1 & "'" ' for string

rec.Open (esql1), conn, adOpenStatic, adLockReadOnly

    Label1.Caption = rec.Fields(0)
 Label2.Caption = rec.Fields(1)
Label3.Caption = rec.Fields(2)
Label4.Caption = rec.Fields(3)
'Check1.Value = rec.Fields(4)
' you need to check if in your access table design you have  Allowed Zero length .. set it to Yes for all text fields.

rec.Close
conn.Close
'Set conn = Nothing


End Sub


thanks

Database Table
I am tring to find a way to get the total number of records in a datebase table.

Thanks,
Jason

Database Table
Hi!, how could I populate list box with a database table? that the user could choose on.



Edited by - jorjie on 2/7/2008 5:48:13 PM

Table From Database
Hello,
I would like to make a table from an Access database, and then to save it in a Word or Acrobat Reader document. Can I do this using Visual Basic? And if so how can I do this?
The table will have columns with fields from different tables from the database and and the rows will be from the records in tha database.
Any suggestion is appreciated. Thanx

Database Table W/ VB
Hello,

First of all i want to start by saying thank you for helping if you can... Here goes the question...

I have created an Access database with with three tables. A zipcode table, an appointment table, and a personal info table. I have created relationship between the zipcode table and personal info table.

What i would like to do in my VB program is to have a text box and give the user the ability to enter the zipcode and automatically populate the city and state textboxes. Extracting information from the zipcode table that already has the info, of course. I know i have to use the ADO component and some SQL language but i don't have any idea how to start this.

Once again thank you for the help.... Email is lito_dc@yahoo.com if you would like to email....



Edited by - danielc on 11/7/2002 5:35:40 PM

Database Table
Hi,

Below I have attach the word document file. Do anyone know how to draw the table. I am so confusing. I do not know which toolbox button should I used for the column in white and blue. Is it text box??

Thanks

Database (table .dbf)
I would like to know how can I make this job verry quickly
because my procedure was to slow.

this is my code

Data1.recoset.moveFirst
Do while Data1.recordset.eof = false
val1 = Data1.recordset(1).value
val2 = Data1.recordset(2).value
val3 = Data1.recordset(3).value
val4 = Data1.recordset(4).value
val5 = Data1.recordset(5).value

request = = "val1 = """ & val1 & """ and val2 = """ & val2 &
""" And val3 = """ & val3 & """ And val4 = """ & val4 & """"
Data2.Recorset.Findfirst request
Do while Data2.recordset.nomatch = false
Data2.Recordset.edit
Data2.Recordset("val5").value = val5
Data2.recordset.update
Data2.Rercordset.Findnext request
Loop

Data1.recordset.movenext

Loop

This code is OK but It was to slow because I have 5000 lines in Data1 and 100000 line in Data2 (around 3 hours)

is't possible to join my table before with key's ?
who can help me ?

Thanks
Rgis

Table Name Of The DataBase
I am working with MS-Acess BackHand and VB.6 Front Hand. I would like to know whether is there any Function/Controls/Reference/Api's that would fetch the name of all the table in Database. By just specifying the path of the Data Base.

Copying A Table From A Database To Another
Hello,

I need to copy a table from one database (a) another database (b) was wondering if their is an easier way to doing this, besides copying one record from recordset (a) to another recordset (b) until I reach the end of the table.

Also I dynamically create database (b), thus database (b) has no tables to start off with. This is a problem because I only know how to open recordsets that refer to a specific table or query result for that database.

I know how to solve my problem the LONG way, but again my question is: "Is their a faster way?".

Thanks to all how reply to this thread, much appreciated. I'm new to VBA so please go easy on the VBA lingo

Sorting A Database Table?
Hallo

I have a Employee Table inside my Database.mdb File. I display the tables contains to the user VIA a Datagrid. I want to sort the Grid Acording to the Employee's name? How do i do this?Must i sort the datagrids colums,or must i sort the table inside the database?Help....

Create Database Table Using ADO
Can anyone here guide me how to create database table using ADO?
I dont wish you all to code for me.
At least give me some tips,links,sample programs and so forth.
I have one sample that use CREATE TABLE but it only allows to name the table inside the code.
I mean, I want my system user to name the table by her/his self..
How is that?
I am new into VB..pls help..

TQ in advance.

Test For Table In Database
test for table in database
ok all i want to do is from my database (in VB) test what tables exist in another database and display a list of them, if possible in a listbox or combo box. but if not just checkbox lables will do.

thanks
DAL

Retrieving Table Name In A Database
can we retrieve the table names in a database using ADO in VB ?

thanks
waqas

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