Saludos prueba con esto
'verifica si existe una tabla
Sub Existe_Tabla(Nombre_Tabla As String) As Boolean
Dim str_sql As String
Dim c As Cursor
Dim n_cantidad As Int
Main.sql_conexion.Initialize(Main.DBFilePath, Main.DBFileName, True)
str_sql = "Select name FROM sqlite_master WHERE Type='table' AND name='" & Nombre_Tabla & "'"
c = Main.sql_conexion.ExecQuery(str_sql)
n_cantidad = c.RowCount
c.Close
Main.sql_conexion.Close
If n_cantidad = 0 Then
Return False
Else
Return True
End If
End Sub
'verifica la existencia de un campo en una tabla
Sub Existe_Campo(Nombre_Tabla As String, Nombre_Campo As String) As String
Private str_sql As String
Dim c As Cursor
Private n_cadena() As String
Private n_campos() As String
Private x As Int
Private Resultado As String
Main.sql_conexion.Initialize(Main.DBFilePath, Main.DBFileName, True)
str_sql = "Select sql FROM sqlite_master WHERE Type='table' AND name='" & Nombre_Tabla & "'"
c = Main.sql_conexion.ExecQuery(str_sql)
If c.RowCount = 0 Then
Return "No Tabla"
Else
c.Position = 0
Resultado = c.GetString("sql")
Resultado = reemplazar(Resultado,"(","|")
Resultado = reemplazar(Resultado,")"," ")
n_cadena = Regex.Split("\|",Resultado)
'obtener los campos
n_campos = Regex.Split(",",n_cadena(1))
For x = 0 To n_campos.Length - 1
If n_campos(x).Contains(Nombre_Campo) Then
c.Close
Main.sql_conexion.Close
Return "SI"
End If
Next
End If
c.Close
Main.sql_conexion.Close
Return "NO"
End Sub
'llamada a la funcion
If Existe_Campo("ConfigMail","Server") = "No Tabla" Then
sql_conexion.Initialize(DBFilePath, DBFileName, True)
sql_conexion.ExecNonQuery("CREATE TABLE ConfigMail (Server TEXT, Puerto TEXT,Cuenta TEXT,Clave TEXT,Protocolo TEXT, SSL TEXT)")
sql_conexion.close
End If