473,402 Members | 2,046 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

VBA code to C sharp

atksamy
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
2 2959
Plater
7,872 Expert 4TB
Look up using a database in your program.
Feb 26 '09 #2
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

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

Similar topics

0
by: Vi | last post by:
Some of you might be interested in this open source AutoUpdater for ..NET "Sharp AutoUpdater provides an auto-update feature for .NET applications. Using XML configuration files, Sharp...
0
by: application | last post by:
is it possible to create a simple com dll in c-sharp? i need to use a c-sharp com from an asp page( not aspx) and i read in google about regasm and csc and some other strage words but never find a...
2
by: Ben | last post by:
Hi all I am new to C Sharp. Any suggestion for some good C Sharp sites? Thanks for sharing. Ben
9
by: Dragon | last post by:
Hi, I have 'some' experience in VB. I would like to learn C-Sharp and would like to know if the following book is any good or not. Thank you. Microsoft Visual C# .NET Step by Step - Version...
1
by: Jet Leung | last post by:
Hello All: I want to rewrite a program by c sharp that was worte by vb. And I have a problem , how to translate "exit sub " of vb into c sharp? And how to run another program (for example a .exe...
23
by: arthur.mcginty | last post by:
Man I've grown tired with C#/.NET the last three days I spent trying to put a NULL value in a database. C# initializes all uninitialized properties to 0 (for numeric types) and didn't have until C#...
2
by: ABC | last post by:
I have a very large amount VB code convert into C Sharp. I just complete it use tools. But it still have some codes errors. There are object to datatype problems. I need to edit many files to...
5
by: Alberto | last post by:
What sharp (from c sharp) stand for or where does it comes from? thank you
20
by: windandwaves | last post by:
Hi Folk I am a PHP programmer, but I like to learn c-sharp as it seems to be in hot demand around here. My questions are: - how does c-sharp relate to PHP - do you like c-sharp and its...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.