Page 1 of 1

Bit Tricky

Posted: Wed Jan 14, 2004 8:26 am
by ol4pr0
Now i know i am about to ask almost the impossible, however i hope there is somebody outthere who has the answer :>


i connecting to a database from a vb program outside the website. ( which adds data 2 the db ) now i wish to make something in php that will automaticly display howmany $rows there were afected.

::(

Posted: Wed Jan 14, 2004 9:11 am
by Saethyr
Need Database flavor(MySQL, Access) also need your code that makes the changes.


Saethyr

flavora

Posted: Wed Jan 14, 2004 9:20 am
by ol4pr0
the flavor as you put it will be mysql

the program works like this. ( plain vb ( not the .net )

By adding data like,

price
number of articles
weight
id_code

it will be automaticly added to the database, however the problem i got now is that the program is running outside the website and does needs to create a XML document which is automacilly send to a 3th party. for that i figured the best way to have it do that is to have a automaticly reconize that a tables inside the db have changed and create the xml document which is been sended to a mail box.. yea i know its kinda dumb doing it like that but thats how it needs to be done for some reason .


if u still need to code on how its being added let me know.

The code

Posted: Wed Jan 14, 2004 10:03 am
by ol4pr0
code concerning connnecting to the db

Code: Select all

Public Sub conectarse()
    Set BdSQL = New ADODB.Connection
    
    Set BdSQL = New ADODB.Connection
    BdSQL.ConnectionString = "DRIVER={SQL Server}; " & _
                             "SERVER=pcpaola; " & _
                             "UID=paola;" & _
                             "PWD=paola"
    
    BdSQL.Open
    BdSQL.DefaultDatabase = "aduana"
    If BdSQL.State = adStateClosed Then
        BdSQL.Open BdSQL.ConnectionString
    End If
    If BdSQL.State = 1 Then
        conectado = True
    Else
        conectado = False
        MsgBox "Hubo un Error, No se pudo conectar al Servidor... Consulte con un Administrador", vbCritical
    End If
End Sub

Public Sub desconectarse()
    If conectado = True Then
        BdSQL.Close
    End If
End Sub

Public Sub Dar_Permisos()
    Dim rsPermisos As ADODB.Recordset
    Dim i As Integer
    Dim arreglo
    Dim k As Integer
    Set rsPermisos = BdSQL.Execute("select m.id_menu, m.nombre_menu from menu m, menu_nivel mn where m.id_menu=mn.id_menu and mn.id_nivel=" & nivel)
    While rsPermisos.EOF = False
        With frmMainAduana
            For i = 0 To .Controls.Count - 1
                If .Controls(i).Name = rsPermisos(1) Then
                    .Controls(i).Enabled = True
                End If
            Next i
        End With
        rsPermisos.MoveNext
    Wend
errMenu:
End Sub

Public Sub Inicializar_Permisos()
    Dim i As Integer
    Dim menu_emer As Menu
    With frmMainAduana
        For i = 0 To .Controls.Count - 1
            If TypeOf .Controls(i) Is Menu Then
                If StrComp(.Controls(i).Name, "mnuBar", vbTextCompare) = 0 Then
                    GoTo 1
                Else
                    .Controls(i).Enabled = False
                End If
1
            End If
        Next i
    End With
End Sub

Hope that willl help you. and me :roll: