Hi there,
Can someone tell me how to connect the Inventor db to PHC db ?
Its an SQL Crystal db on manufactor... but I dont know what is of the inventor...
Gratefully,
Fred
Hi
Can you be more precise about what you are looking for?
What is it that you call the Inventor db exactly?
Thank you.
Philippe.
All the information codes that I put is this:
Function ligasql()
Dim nomeBancoDados, nomeUsuario, senha As String
nomeBancoDados = "ITAVARES"
nomeUsuario = "fred"
senha = "1234"
'Declare variables'
Dim objMyConn As ADODB.Connection
Dim objMyCmd As ADODB.Command
Dim objMyRecordset As ADODB.Recordset
Set objMyConn = New ADODB.Connection
Set objMyCmd = New ADODB.Command
Set objMyRecordset = New ADODB.Recordset
'Open Connection'
objMyConn.ConnectionString = "Provider=SQLOLEDB;Data Source=ITAVARES;User ID=fred;Password=1234;"
objMyConn.Open
'Set and Excecute SQL Command'
Set objMyCmd.ActiveConnection = objMyConn
objMyCmd.CommandText = "select NUMOF from tabOf"
objMyCmd.CommandType = adCmdText
objMyCmd.Execute
'Open Recordset'
Set objMyRecordset.ActiveConnection = objMyConn
objMyRecordset.Open objMyCmd
MsgBox (objMyRecordset.Index(1))
'Dim db As database
'Dim strConnection As String
'Set ws = DBEngine.Workspaces(0)
'Let strConnection = "ODBC;DSN=ITAVARES;UID=fred;PWD=1234"
'Set db = ws.OpenDatabase("", False, False, strConnection)
'"Data Source=ITAVARES;Provider= MSDASQL.1;Initial Catalog=Manit;Persist Security Info=True;User ID=fred;Password=1234; Option =3 "
' oConn.Open
'Dim rs As Recordset
'Set rs = db.openrecordset(NUMOF)
'Do While Not rs.EOF
' intID = rs!IDField
' MsgBox (intID)
' rs.MoveNext
'Loop
'rs.Close
'Set rs = Nothing
'rs.ActiveConnection = oConn
'rs.Open "SELECT * from tabOf"
End Function
Im trying to connect to another table, but I cant make the MSGBOX appear with the "name" or the information of the table 😞
I dont understand to much of SQL xD
Well, this forum focuses on Inventor API specific questions. What you are asking there seems to be more related to SQL/ADO. You may have more luck seeking advice on an ADO dedicated forum or directly browsing the web for some tutotrials.
Sorry for not being more helpful.
Regards,
Philippe.