Cri_Lancelot Posted July 12, 2011 Report Share Posted July 12, 2011 (edited) Hola a todos en el foro, nose si esta consulta va aqui pero igual lo voya hacer mi consulta es la siguiente: quiero saber como poder hacer una consulta en access que cuente las columnas dentro de una base de datos access ya que en sql server los puedo hacer es asi: SELECT count(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'USERINFO' AND COLUMN_NAME like 'TextoEditable%' pero en access no funciona espero me ayuden ******************************[solucion]************************************** Ya Solucione mi problema n.n Dejo el codigo por si es que le sirve a alguien El codigo esta hecho en .Net Private Sub NombreColumnas(ByVal ds As DataSet) Dim cont As Integer = 0 Dim comm As OleDb.OleDbCommand Dim c As New OleDb.OleDbConnection Dim consulta As New ConsultasSql Dim conSql As New ConexionSql conSql.dataset(ds, "select * from USERINFO ", EditarUsuarios.proveedor) Dim table As DataTable Dim column As DataColumn ' For each DataTable, print the ColumnName. For Each table In ds.Tables For Each column In table.Columns If column.ColumnName Like "TEXTOEDITABLE*" Then cont += 1 End If Next Next If cont = 0 Then base.AbrirAcc© comm = New OleDb.OleDbCommand("ALTER TABLE USERINFO ADD TEXTOEDITABLE1 varchar(20) , TEXTOEDITABLE2 varchar(20),TEXTOEDITABLE3 varchar(20)", c) comm.ExecuteNonQuery() base.CerrarAcc© End If End Sub Edited July 18, 2011 by Cri_Lancelot Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now