can anybody tell me why this function is not working . i have written
a this function in module and i have called in a stock1 form but it is
not working there.can you tell me why bold line is not working.

here is the code written in a module :

Function GetconnectionString() As String ' The result needs to be a string !!!
Dim con As ADODB.Connection
Set con = New ADODB.Connection
con.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=\asfserver\itp$\Product_tabletest.mdb")
GetconnectionString = "providwer=Microsoft.jet.OLEDB.4.0;"
End Function

here is the code written in form_load()

Private Sub Form_Load()
Combo1.AddItem "Production Consumable"
Combo1.AddItem "Maintenance Consumable"
Combo1.AddItem "Tools Consumable"
Set con = New ADODB.Connection
'con.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=\asfserver\itp$\Product_tabletest.mdb")
'Label10.Caption = Date
<strong>con.ConnectionString = GetconnectionString()</strong>
Label10.Caption = Format$(Now, "dddd, d mmmm yyyy")
Text1.CausesValidation = True
End Sub

8 Years
Discussion Span
Last Post by systemautorizin

Your code is working allright here on ,y machine i think you need to re-enter your database location caz i only got error of the database location when i edit the database location code it connects hope this will help you alot
Best of luck

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.