VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Code to display column name,size,date created,datatype,defined size for any database using Adox

by Sachin Pendgaonkar (1 Submission)
Category: Active Server Pages
Compatability: ASP (Active Server Pages)
Difficulty: Unknown Difficulty
Originally Published: Sat 29th December 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Code to display column name,size,date created,datatype,defined size for any database using Adox

Rate Code to display column name,size,date created,datatype,defined size for any database using Adox



'*******************************************************
'* Author:sachin pendgaonkar    *
'* Purpose: To display table details

'*******************************************************
Option explicit
Dim recs,count
set recs=server.CreateObject("adox.catalog") 
'Conection String For sql server
recs.ActiveConnection ="dsn=test;database=test;uid=userid;pwd=password"
'Conection String For Access database
'recs.ActiveConnection "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("2.mdb")

%> <i><b><font face="Arial" size="2">Table Column Details </font></b></i> 
<table width="80%" border="0" cellspacing="0" cellpadding="2">
  <tr> 
    <td width="23%"><b><font face="Arial" size="2">Column name</font></b></td>
    <td width="17%"><b><font face="Arial" size="2">Size</font></b></td>
    <td width="24%"><b><font face="Arial" size="2">Data Type</font></b></td>
    <td width="36%"><b><font face="Arial" size="2">Numeric Sale</font></b></td>
    <td width="36%"><font face="Arial" size="2"><b>Date created</b></font></td>
  </tr>
  for count=0 to recs.Tables("table1").Columns.Count-1%> 
  <tr> 
    <td width="23%"><font face="Arial" size="2">=recs.Tables("table1").Columns(count)%></font></td>
    <td width="17%"><font face="Arial" size="2">=recs.Tables("table1").Columns(count).DefinedSize%></font></td>
    <td width="24%"><font face="Arial" size="2">=recs.Tables("table1").Columns(count).Type%></font></td>
    <td width="36%"><font face="Arial" size="2">=recs.Tables("table1").Columns(count).NumericScale%></font></td>
    <td width="36%">=recs.Tables("table1").DateModified%></td>
  </tr>
  next%> 
</table>

recs.close
set recs=nothing
%>

Download this snippet    Add to My Saved Code

Code to display column name,size,date created,datatype,defined size for any database using Adox Comments

No comments have been posted about Code to display column name,size,date created,datatype,defined size for any database using Adox. Why not be the first to post a comment about Code to display column name,size,date created,datatype,defined size for any database using Adox.

Post your comment

Subject:
Message:
0/1000 characters