24. august 2006 - 08:37Der er
10 kommentarer og 1 løsning
Connecte til ekstern database (View)
Hej,
Jeg har fölgende kode: ----- If Not IsNull(DLookup("[No_]", "[dbo.vw_Thorn_Svenska_AB$Customer]", "[No_]=txtKundenr")) Then sSQL = "INSERT INTO Labels ([Kundenr])" & vbCrLf & _ "SELECT ([No_])" & vbCrLf & _ "FROM [dbo.vw_Thorn_Svenska_AB$Customer] WHERE [No_] = " & txtKundenr.Value Me.Requery DoCmd.RunSQL sSQL Else MsgBox "Kundenr. " & txtKundenr & " kendes ikke", vbExclamation
End If txtKundenr = "" txtKundenr.SetFocus
End Sub -----
Den henter fra en linked table (view) i Access: dbo.vw_Thorn_Svenska_AB$Customer
Den giver fölgende fejlmeddelelse: Run time error 3078 The Microsoft Jet Database engine cannot find the input table or query 'dbo.vw_Thorn_Svenska_AB$Customer'. Make sure it exists and that its name is spelled correctly.
I dette særtema om aspekter af AI ser vi på skiftet fra sprogmodeller til AI-agenter, og hvordan virksomheder kan navigere i spændet mellem teknologisk hastighed og behovet for menneskelig kontrol.
Have you linked the view using a DSN (ODBC) connection? If so, can you open the view directly? Can you also make a query using the linked table? If you can then you should be able to use the view in the code above.
I´ve tried to make a simple query in Access that withdraws "no_" and "name" from the view [dbo.vw_Thorn_Svenska_AB$Customer] and it works perfect, but somehow it won´t work with the code above. It´s a ODBC connection! :-) and i can open it (doubleclick) and se all the values/customers.
Now i got another message. It seems like the connection to the view works now but i get the following halt: Data type mismatch in criteria expression.
When i do what you told me i got following: ?sSQL INSERT INTO Labels ([Kundenr]) SELECT ([No_]) FROM [dbo_vw_Thorn_Svenska_AB$Customer] WHERE [No_] = 17116516
I´ve checked that [No_] field is the same type as in table Labels (Text) and that the value is 20. Now i´m lost :-)
He he! I´ve got i working. All i needed to do was add ' & ' (where the number was, 17116516)in this line: FROM [dbo_vw_Thorn_Svenska_AB$Customer] WHERE [No_] = 17116516
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.