By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,276 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

VBA code to C sharp

atksamy
P: 91
HI,

I am trying to convert this code snippet which is in VBA to C sharp. Can someone guide me

Expand|Select|Wrap|Line Numbers
  1. Dim cn As New ADODB.Connection, cn2 As New ADODB.Connection
  2.                             Dim rs As ADODB.Recordset
  3.                             Dim rs3 As DAO.Recordset
  4.                             Dim connString As String
  5.                             Dim SelectFieldName
  6.  
  7.                             Set cn = CurrentProject.Connection
  8.                             SelectFieldName = astrFields(intIx)
  9.                             Set rs = cn.OpenSchema(adSchemaColumns, _
  10.                             Array(Empty, Empty, Empty, SelectFieldName))
  11.  
  12.                             'Exclude MS system tables '
  13.                             If Left(rs!Table_Name, 4) <> "MSys" And Left(rs!Table_Name, 4) <> "Abfr" Then
  14.                             strSql = "SELECT t.[" & astrFields(intIx) & "], t.fall from [" & rs!Table_Name & "] t Inner Join 01UMWELT on t.fall = [01UMWELT].fall Where [01UMWELT].Status = 4"
  15.                             End If
  16.  
  17.                             Set rs3 = CurrentDb.OpenRecordset(strSql)
Thanks
Feb 26 '09 #1
Share this Question
Share on Google+
2 Replies


Plater
Expert 5K+
P: 7,872
Look up using a database in your program.
Feb 26 '09 #2

P: 1
Hi there,

A really useful tool for converting VB.NET to C# and back is provided by Telerik at the following url: http://converter.telerik.com/

Hope that helps,

Matt.
http://www.targethelpdesk.com
Feb 26 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.