Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Other Development Tools
 Visual basic/datagrid

Author  Topic 

husseinj
Starting Member

8 Posts

Posted - 2004-08-11 : 03:54:21
Hi all,
I am developing an application with VB and sqlserver.
I have a datagrid in vb and it shows results from the choices i do like combo box and so on. This is working on fine.
Now what i want to do is do a mail merge from the results i get in my datagrid. Does anyone know how i can do it?
Can I transfer the results in a sqlserver table?
Thanks for all help

amitkumarmadhukar
Starting Member

45 Posts

Posted - 2004-08-11 : 08:08:53
What u actually want
1. Either Collect information from your Datagrid in a file or what

2. or read simply more than one grid's information/result and merge all

3. what ?
Please describe much clear i hope i or any member of this great fourrum are trying to solve.



amit kumar madhukar
Go to Top of Page

husseinj
Starting Member

8 Posts

Posted - 2004-08-13 : 03:17:06
Thanx for replying
It would be good if i can store the data i get from my datagrid in a file.

Please can you help me with this syntax:
Actually am using this syntax for ms access 2003 and its working on fine.
The problem is with the date
dim x as Date
x = DTPicker1.Value
If Combo1.Text = "All" Then

Adodc1.RecordSource = "select POL_REF_NO, FREQ, NX_EXP_PR_DT, GROSS_PREMIUM" & _
" from POLICY" & _
" where (POL_STAT = 'A')" & _
" and (freq = 1)" & _
" and (nx_exp_pr_dt = #" & x & "# )"

Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1


It does not understand the (nx_exp_pr_dt = #" & x & "# ), i think its a syntax problem. it does not understand the # sign?
Can anyone please help me




Go to Top of Page

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2004-08-13 : 20:50:08
Have you tried running the query directly in the Access query designer? This will help you get the formatting right, because I suspect it doesn't like the date format.
As for persisting to a file, just create a recordset of the grid contents (you should be able to do a
Set rst = Adodc1
, where rst is your recordset. Then call the recordset save method which allows you to save the recordset contents as an XML file.
Go to Top of Page
   

- Advertisement -