Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old December 27th, 2004, 03:04 AM
kmalika kmalika is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 24 kmalika User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m
Reputation Power: 0
create table in html file within vb6

hello everybody
i'm working in my vb6 project.i have already created a .htm file and i want to create a table in that file.i have used vbcrlf to take records from my database in that .htm file .this is the code that i have used to create and print records in .htm file at vb runtime

Open "abc.htm" For Output As #3 ' creates file "abc.htm"
Print #3, rs1.GetString(,100,vbtab, vbCrLf," "); 'prints selected records in the file
Close #3 'closes the file
file automatically creates at runtime and records will go according to user's choice but records are coming in a single line but i want to create a table so that records can come in a table itself .
plz anyone help me
i'll be greatful to him/her.

Reply With Quote
  #2  
Old December 27th, 2004, 03:39 AM
satishkumarj satishkumarj is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 109 satishkumarj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 1 h 37 m
Reputation Power: 4
Hi malika,

Instead of using vbCrLf as RowDelimeter use "<br>" tag in ur code i think it will give the expected out put,

Code:
  
 
Open "abc.htm" For Output As #3 ' creates file "abc.htm"
Print #3, rs1.GetString(,100,vbtab, "<br>"," "); 'prints selected records in the file
Close #3 'closes the file
 



Regards,
Satish Kumar J..

Reply With Quote
  #3  
Old December 27th, 2004, 04:09 AM
kmalika kmalika is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 24 kmalika User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m
Reputation Power: 0
sorry satish its not workintg .actually i have used that vbcrlf for taking selected records from my database.but here in my html file i want to show that records in tabular format.only tell me the way to create that table

Reply With Quote
  #4  
Old December 27th, 2004, 04:28 AM
satishkumarj satishkumarj is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 109 satishkumarj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 1 h 37 m
Reputation Power: 4
Lightbulb

Hi malika,

I will write a code for ur requirement, if u think that is longest way then leave it a side

I am not writting whole code, i am giving u the idea...
'sample code

Code:
Dim StrHtml as String 
 
StrHtml = "<table align='center' width='100%'>"
 
do not rs.eof
	  StrHtml = StrHtml & "<tr>"
	  For i=0 to rs.fields.count-1
			StrHtml = StrHtml & "<td>" & rs(i) & "</td>"
	  Next
	  StrHtml = StrHtml & "</tr>"
	  rs.movenext
loop
StrHtml = StrHtml & "</table>"
 
Open "abc.htm" For Output As #3 ' creates file "abc.htm"
Print #3, StrHtml 'prints selected records in the file
Close #3 'closes the file

Hope this will helps u,


Regards,
Satish Kumar J...

Reply With Quote
  #5  
Old December 27th, 2004, 04:44 AM
kmalika kmalika is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 24 kmalika User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m
Reputation Power: 0
thanks Satish.like Access i have to create a table in .htm file using vb6 at run time and datas should come in that table itself.for e.g in Access or in excel too many columns and rows are there and datas come in that rows and column itself.like that i hve to show datas in atable in my .htm file using vb6 at runtime

Reply With Quote
  #6  
Old December 27th, 2004, 04:55 AM
satishkumarj satishkumarj is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 109 satishkumarj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 1 h 37 m
Reputation Power: 4
Question

Quote:
Originally Posted by kmalika
thanks Satish.like Access i have to create a table in .htm file using vb6 at run time and datas should come in that table itself.for e.g in Access or in excel too many columns and rows are there and datas come in that rows and column itself.like that i hve to show datas in atable in my .htm file using vb6 at runtime

Hi,

I am sorry i not getting u properly, if u need data in tabular format then use
Code:
 border='1' 
in <table> tag in the code which i have given u in last post....
if ur requiment is not what i am thinking sorry for disturbance...


Cheers,
Satish

Reply With Quote
  #7  
Old December 27th, 2004, 05:15 AM
kmalika kmalika is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 24 kmalika User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m
Reputation Power: 0
no not at all.thanks yaar .thanks a lot .your code works it represents data in a good manner means daas are coming like this.

name city
Madhu Delhi
before applying your code all datas are coming in a single line .but now this is fine but only problem is tables are not created.when i click on"edit with Microsoft Word" then in MS Word table is created and datas are coming in the table.i cannot draw a table here there is no tools available.i think now u r clear whats my doubt.

Reply With Quote
  #8  
Old December 27th, 2004, 05:28 AM
satishkumarj satishkumarj is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 109 satishkumarj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 1 h 37 m
Reputation Power: 4
Arrow Last Try...

Hi malika,

I am changing some of the code i have given u last time so that it will display the table format in the htm file

Dim StrHtml as String

StrHtml = "<table align='center' width='100%' border='1'>"
StrHtml = StrHtml & "<tr aling='center'><th width='50%'>Name</th><th width='50%'>City</th>"
do not rs.eof
StrHtml = StrHtml & "<tr>"
For i=0 to rs.fields.count-1
StrHtml = StrHtml & "<td>" & rs(i) & "</td>"
Next
StrHtml = StrHtml & "</tr>"
rs.movenext
loop
StrHtml = StrHtml & "</table>"

Open "abc.htm" For Output As #3 ' creates file "abc.htm"
Print #3, StrHtml 'prints selected records in the file
Close #3 'closes the file


Cheers,
Satish

Reply With Quote
  #9  
Old December 27th, 2004, 06:22 AM
kmalika kmalika is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 24 kmalika User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m
Reputation Power: 0
thanks a lot Satish.thanque very much.your code is working very well.table is creating in html and datas are displaying in columns and rows.ver very thanks.you're great.
with regards
madhu

Reply With Quote
  #10  
Old December 27th, 2004, 06:46 AM
satishkumarj satishkumarj is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 109 satishkumarj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 1 h 37 m
Reputation Power: 4
Talking

Hi madhu,

you are welcome any time u can directly contact me at j_satish_kumar@hotmail.com



i think ur praising me more................



Regards and happy coding.

Satish Kumar J.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > create table in html file within vb6


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT